Skip to main content
Known Participant
July 22, 2008
Question

[IDS CS2]How to get activeScriptPath using javascript?

  • July 22, 2008
  • 1 reply
  • 445 views
Hi all,

How to get the active script path using IDS CS2(javscript)
I tried the following code :

var mypath=app.activeScript.path;

but it gives the following error:

Error Number:30490
No file is associated with the currently active script.

Please advise.

Regards
myRiaz
This topic has been closed for replies.

1 reply

Inspiring
July 22, 2008
You'll get that error if you're running from ESTK. I use this function:

function getScriptFile() {

// This function returns the file of the active script, even when running ESTK
try {
return app.activeScript;
} catch(e) {
return File(e.fileName);
}
}


Dave