How do I create a folder using ExtendScript?

亡梦爱人 提交于 2019-12-03 16:16:39
    var f = new Folder('/c/myfolder/');
    if (!f.exists)
        f.create();

Okay, found a work-around: I have to specify the folder absolutely, rather than use the ~ home shortcut. In addition, I have use /Volumes at the very beginning. Thus, the code becomes:

var f = new Folder("/Volumes/apache HD/Users/apache/Desktop/my_new_fodler");  
f.create();

And that seems to work, finally. Thanks for your help, @Anna Forrest and @fabiantheblind! (You seem to be the resident ExtendScript expert around here.)

try this:

var f = new Folder("~/Desktop/my_new_fodler");  
f.create();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!