Creating a folder fails [#18271]

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Creating a folder fails [#18271]

Re: Creating a folder fails [#18271]

by Peke » Sat Oct 02, 2021 1:15 pm

Hi,
API Docs updated and function is available (2507 tested)

Re: creating a folder

by chrisliebaer » Sat Sep 11, 2021 6:50 am

Ludek wrote: Fri Sep 10, 2021 2:53 pm

Code: Select all

fs.getFolderFromString(dir_out).createFolder("M3U");
Works like a charm! Thought about something like this, but didn't get it to work either.
Thank you! :D

Re: creating a folder

by Ludek » Fri Sep 10, 2021 2:53 pm

Hi,
just checking our documentation https://www.mediamonkey.com/docs/api/cl ... FromString
and you seem to be right that getFolderFromString description is "Creates new folder", but actually it does not create any folder just gets the 'SharedFolder' object that isn't documented though.

I entered the issue as https://www.ventismedia.com/mantis/view.php?id=18271 to be fixed for 5.0.2

Current workaround for you should be something like this:

Code: Select all

fs.getFolderFromString(dir_out).createFolder("M3U");

Creating a folder fails [#18271]

by chrisliebaer » Thu Sep 09, 2021 12:43 pm

Hi MM-Lovers,
in VBS (MM 4) i had my own export script where i created my own directory tree. When the directory tree already existed i deleted it and created it new.
Now (on MM 5 with JS) i have problems creating a new folder. Script runs without any problems but the new directory willl not be created... Any ideas? What am I doing wrong? :roll:

Code: Select all

var fs = app.filesystem;
var dir_out = "C:\\Test";
if(fs.dirExists(dir_out + "\\M3U"))
{
	fs.deleteFolderAsync(dir_out + "\\M3U", false, false);
	fs.getFolderFromString(dir_out + "\\M3U");
}
else
{
	fs.getFolderFromString(dir_out + "\\M3U");
}

Top