Copy link to clipboard
Copied
Hi.
Can I determine the location of the currently running script? I need the "filePath".
My intension:
The script is running and changes/makes things in InDesign. Then I want it to load another script from the same folder which one does its own work.
var path = new File($.fileName);
var filePath = path.parent
-Manan
Copy link to clipboard
Copied
Try $.fileName
-Manan
Copy link to clipboard
Copied
That´s not bad. But I need only the path, without the name. Is that possible?
Copy link to clipboard
Copied
var path = new File($.fileName);
var filePath = path.parent
-Manan
Copy link to clipboard
Copied
Thanks Manan.
I make it like:
var thisScript = new File($.fileName);
var thisScriptPath = thisScript.parent;
var newScript = File(thisScriptPath + "/newFileName.jsx");
it´s perfect!
Copy link to clipboard
Copied
I do it like this:
var globalScriptPath = getScriptPath().path;
function getScriptPath() {
try {
return app.activeScript;
} catch(e) {
return File(e.fileName);
}
}
Copy link to clipboard
Copied
Hey Stafan:
der sagt mit hierbei:
"Skript kann in Zielengine "main" nicht ausgeführt werden! (cannot execute in main-engine)
(#21) undefined is not an object"
...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now