Copy link to clipboard
Copied
Hello all! After playing with Photoshop scripting, I'm now playing with AE too, and in my first try I've stuck in finding the scripts path from the script itself.
In Photoshop, there was this piece of code that somebody in the Photoshop Scripting forum kindly shared:
var scriptsPath = new Folder (app.path + "/" + localize ("$$$/ScriptingSupport/InstalledScripts=Presets/Scripts"));
But this line doesn't work in After Effects because app.path variable doesn't exist (very funny, I thought Photoshop and After Effects shared the same basic app variables) and the path given to the "localize" function is wrong in AE (I think "$$$" means nothing to it).
Can somebody give me a clue about how to solve this? Thanks a lot in advance 🙂
1 Correct answer
This script shows a couple of examples you can try. The first part shows a way to get the folder the running script is in. The second gets the main AE app folder although I don't know if appFolder works on Windows (you'd still need to add /Scripts on Mac or /SupportFiles/Scripts on Win).
var thisScript = new File($.fileName);
var containingFolder = new Folder(thisScript.parent.absoluteURI);
alert("This script is in " + containingFolder.absoluteURI);
var appFolder = new Folder(Folder.appPackage.paren
...Copy link to clipboard
Copied
This script shows a couple of examples you can try. The first part shows a way to get the folder the running script is in. The second gets the main AE app folder although I don't know if appFolder works on Windows (you'd still need to add /Scripts on Mac or /SupportFiles/Scripts on Win).
var thisScript = new File($.fileName);
var containingFolder = new Folder(thisScript.parent.absoluteURI);
alert("This script is in " + containingFolder.absoluteURI);
var appFolder = new Folder(Folder.appPackage.parent.absoluteURI);
alert("The app folder is at " + Folder.decode(appFolder.absoluteURI));
Copy link to clipboard
Copied
It works! The second option is better for me, as I'm developing with ExtendScript and the script file is not in the script directory yet.
Thanks a lot, Paul

