Creating a folder fails [#18271]

To discuss development of addons / skins / customization of MediaMonkey v5 / v2024

版主: jiri, drakinite, Addon Administrators

回复
chrisliebaer

Creating a folder fails [#18271]

帖子 由 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:

代码: 全选

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
帖子: 5132
注册时间: 周五 3月 09, 2007 9:00 am

Re: creating a folder

帖子 由 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:

代码: 全选

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

Re: creating a folder

帖子 由 chrisliebaer »

Ludek 写了: ↑周五 9月 10, 2021 2:53 pm

代码: 全选

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
帖子: 18778
注册时间: 周二 6月 10, 2003 7:21 pm

Re: Creating a folder fails [#18271]

帖子 由 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
图片
图片
图片
How to attach PICTURE/SCREENSHOTS to forum posts
回复