Creating a folder fails [#18271]

To discuss development of addons / skins / customization of MediaMonkey.

Moderators: jiri, drakinite, Addon Administrators

chrisliebaer

Creating a folder fails [#18271]

Post by chrisliebaer »

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");
}
Ludek
Posts: 4958
Joined: Fri Mar 09, 2007 9:00 am

Re: creating a folder

Post by Ludek »

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");
chrisliebaer

Re: creating a folder

Post by chrisliebaer »

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
Peke
Posts: 17457
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Creating a folder fails [#18271]

Post by Peke »

Hi,
API Docs updated and function is available (2507 tested)
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Post Reply