JSFL Get Path of Current Script

Seen alot of confusion with this while searching the web. What I want to do is get the folder path of the script that is currently running. The below code is in URI format and includes the trailing slash. I love automation with scripts so I get to use these features alot:

var scriptURI=fl.scriptURI;
scriptURI=scriptURI.substr(0,scriptURI.lastIndexOf("/")+1);

To get the same path in format of your platform:

var scriptPath=fl.scriptURI;
scriptPath=scriptURI.substr(0,scriptURI.lastIndexOf("/")+1);
scriptPath=FLfile.uriToPlatformPath(scriptURI);

Comments are closed.