Skip to main content
Ian Proudfoot
Legend
May 26, 2010
Question

[CS4/JS] Cannot find Folder.appData on a Mac

  • May 26, 2010
  • 1 reply
  • 3241 views

I'm using ExtendScript with InDesign CS4. Developing on Windows, but the users will also use Macs.

Everything works well on both platforms but I get inconsistent results with File and Folder objects on the Mac.

So this works perfectly on Windows:

var savePng = new File (Folder.appData +'/ProjectName/Resources/save.png');

But it fails on the Mac. Yes I believe that I have followed the instructions in the JavaScript tools Guide, so what am I missing. I admit to having very little experience of the way the Mac uses file and folder paths so perhaps it's obvious to some of you?

Thank you

Ian

This topic has been closed for replies.

1 reply

John Hawkinson
Inspiring
May 26, 2010

How does it fail?

On this Mac, the JavaScript console says:

Folder.appData
Result: /Library/Application%20Support

And "/Library/Application Support" should not be writable by normal users (only the superuser). Why did you want appData? Do you need persistant storage across multiple users?

John Hawkinson
Inspiring
May 26, 2010

Also, if it's any help:

{ var p=Folder, pr=p.reflect.properties; for (i in pr)  $.writeln(pr+"\t"+p[pr])}

prototype[object Folder]
fsMacintosh
current/Applications/Adobe%20InCopy%20CS3/Adobe%20InCopy%20CS3.app/Contents/MacOS
startup/Applications/Adobe%20InCopy%20CS3/Adobe%20InCopy%20CS3.app/Contents/MacOS
appPackage/Applications/Adobe%20InCopy%20CS3/Adobe%20InCopy%20CS3.app
system/System
trash~/.Trash
temp/private/var/folders/Sp/SpQckt-vHf01M0CWQR9UjE+++TM/TemporaryItems
userData~/Library/Application%20Support
appData/Library/Application%20Support
commonFiles/Library/Application%20Support
myDocuments~/Documents
desktop~/Desktop
reflect[object Reflection]
argumentsnull
length1
arity1
nameFolder
__proto__

(Yes, I cheated, this is InCopy CS3 not InDesign CS4. It's handy and in front of me, and I'm pretty sure it's effectively the same for this purpose.)