I want to get the absolute folder path of current running Extendscript.
i.e __DIR__
in php (or) __dirname
in nodejs. Equivalent in Extendscript.
Found it myself, it is $.fileName
For the folder name, it is (new File($.fileName)).parent
I wrote an article about this you may find helpful, :)
essentially:
var myPath = (app.activeDocument.fullName.parent.fsName).toString().replace(/\\/g, '/');
var myScriptPath = (File(app.activeScript.fullName).parent.fsName).toString().replace(/\\/g, '/');
alert('Document path is: ' + myPath + ' , and script path is: ' + myScriptPath);
mim,
File($.fileName).path;
Seems to do the job nowadays
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With