Copy link to clipboard
Copied
Hi,
I'm working on an extension which works fine on Windows but has one little problem on Mac.
I'm not able to create the directory 'MY FOLDER'. Here is the code:
var myResourcesFolderPath = Folder.appData.toString() + encodeURI("/MYFOLDER/");
var myResourcesFolder = Folder(myResourcesFolderPath);
if (!myResourcesFolder.exists && !myResourcesFolder.create()){
alert("Cannot create folder");
return null;}I can't understand what the problem is!
If I either change the code to
var myResourcesFolderPath = Folder.appData.toString() + encodeURI("/TESTFOLDER/MYFOLDER/");
var myResourcesFolder = Folder(myResourcesFolderPath);
if (!myResourcesFolder.exists && !myResourcesFolder.create()){
alert("Cannot create folder");
return null;}and manually create the folder 'TESTFOLDER', then the folder 'MYFOLDER' is created. What the heck?
Any ideas?
Copy link to clipboard
Copied
Well, there is that annoying thing called user permissions even on Mac. It's actually logical - only manualyl creating a folder gives you correct write permissions for the script, which in turn means that your root permissions on the volume or parent original parent folder are restricted somehow. Check this stuff.
Mylenium
Copy link to clipboard
Copied
Yes I thought it was something related to user permissions.
I've changed
Folder.appDatato
Folder.userDataand it now seems to work fine.
Thanks!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more