Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

ExtendScript Oddity with File/Folder on Mac OS X

$
0
0

Here's a really odd one, happens on Mac OS X Lion 10.7.3 with InDesign CS5.5.

 

Enter the following little InDesign Script in ExtendScript Toolkit, and run it targeting InDesign CS5.5:

 

// Create a path of the form /Users/kris/Desktop or something similar, then resolve the path back to a File object

var fn = File(File("~").fsName + "/Desktop");

alert(fn.fsName + " exists: " + fn.exists);

 

If all is well, you get a dialog saying something like "/Users/kris/Desktop exists: true".

 

Nothing weird yet. Leave ExtendScript Toolkit running for a sec.

 

Now start up a Terminal window, and go to the /Volumes folder. Create a subfolder called Users (so  that the folder /Volumes/Users exists on your computer).

 

Re-run the script.

 

Weirdness: I get "/Volumes/Users/kris/Desktop exists: false". Euh?

 

Anyone seen that before? Don't forget to remove "/Volumes/Users" again!

 

It is probably related to another weirdness. Run this one-liner:

 

alert(File("///").fsName);

 

You'll get "/Volumes" - but you'd expect to get "/", no?


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>