2 Replies Latest reply on May 23, 2012 12:25 PM by stevedita2012

    Issue in creating folder via JS on OS X

    stevedita2012

      Hi, all,

       

      I use folder.create(path) to create a new folder, where path is of course the full path to where I want the folder created. I'm using InDesign CS 5.5 and OS X Lion. For many weeks, I've used the following code just fine:

       

                      myFolder = "~/Desktop/hi";

                      myCreatedFolder = new Folder (myFolder);

       

      As expected, the folder would be created in the Desktop folder of my user account. And then all of a sudden it stopped working: The folder would not be created. I discovered the culprit but I don't know WHY this is the cause. There is a server I connect to that mounts a folder called "users" in /Volumes such that there is a path there of "/Volumes/users". For some reason, the path of "~/Desktop" is being interpreted as "/Volumes/users/Desktop", which I don't have permission to write to so the folder creation fails. If I change the code so that it is:

       

      myFolder = "/Users/myusername/Desktop/hi";

       

      It still fails. It seems that the "/" is being interpreted as being "Start in /Volumes" rather than the file system's "/". If I disconnect from the server and therefore unmount "/Volumes/users" the script works fine and creates the directory "hi" on my Desktop.

       

      (InDesign is installed locally; the file I am running the script on is local; and the desired write location is also local.)

       

      Has anyone experienced anything similar?

       

      Thanks,

      Steve