Reputation: 6967
This got me stumped.
In a (Windows) batch file I can file the name of the file and path of said batch file with:
SET thisfile=%~f0
ECHO thisfile
C:\Users\GwenStefani>C:\projects\scripts\this_file.bat
However, I want to do this is Photoshop. I can find the name of the current document with:
var myPath = app.activeDocument.path;
var myDoc = myPath + "/" + app.activeDocument.name;
alert(myDoc);
...But the file path (and name) of the script that's just be called - I'm all out of ideas. Anyone?
Upvotes: -1
Views: 47
Reputation: 6967
After a let more digging, I found what you after, recorded here for my future self:
var myScript = $.fileName;
alert(myScript);
/c/somefolder/gwen/stefani/myscript.jsx
Upvotes: 0