Skip to main content
Participant
May 23, 2012
Answered

Issue in creating folder via JS on OS X

  • May 23, 2012
  • 1 reply
  • 1804 views

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

This topic has been closed for replies.
Correct answer absqua

Has anyone experienced anything similar?

Someone has: see this recent thread, which has a fix.

Jeff

1 reply

absquaCorrect answer
Inspiring
May 23, 2012

Has anyone experienced anything similar?

Someone has: see this recent thread, which has a fix.

Jeff

Participant
May 23, 2012

Wow. I am as blind as a bat. Perhaps even more blind than one.

Thanks, Jeff! I appreciate it.

Steve