Skip to main content
Known Participant
February 28, 2008
Question

path to scripts folder

  • February 28, 2008
  • 2 replies
  • 415 views
Hi,

am i right to assume that this:

var scriptsFile = new File($.fileName);
will cause a problem in running as a script as binary (because of the $)

and if so

is there a way to find the scriptsfolder, other than

var scriptsFile = app.scriptPreferences.scriptsFolder
because that takes you to the scriptsfolder in the Library/Preferences, and I want to end up in the app folder.

Just to clarify: I don't want my client to be able to accidently open the script by doubleclicking on it, so I want it to be a binary. But i need to figure out where it is in order to find some datafiles.

Thanks,

james
This topic has been closed for replies.

2 replies

Known Participant
March 3, 2008
Hi Dirk,

that did the trick! Thanks a lot!
Inspiring
March 1, 2008
Something like this?

try {
var activeScript = app.activeScript;
} catch(e) {
// running from ESTK ...
var activeScript = File(e.fileName);
}
alert(activeScript.parent);