you'll get C:\Program Files\Adobe\Adobe Photoshop CC 2015\[scriptName.jsx]
you'll get /c/Program Files/Adobe/Adobe Photoshop CC 2015/[scriptName.jsx]
Or, to get the folder:
you'll get C:\Program Files\Adobe\Adobe Photoshop CC 2015
you'll get /c/Program Files/Adobe/Adobe Photoshop CC 2015
You only need to use decodeURI() if not getting fsName, because fsName result is always decoded.
It's not working.
Using your first example, I get:
C:\Program Files\Adobe\Adobe Photoshop CC 2015\526
then the second time I use it I get
C:\Program Files\Adobe\Adobe Photoshop CC 2015\527
The number increments for each time I run the function where I have alert(File($.fileName).fsName);
Oh I have noticed just now that you are not putting your scripts in the scripts folder.
They should be here:
C:\Program Files\Adobe\Adobe Photoshop CC 2015\Presets\Scripts\
I have put a script jsx file in the photoshop scripts folder containing this:
and the alert came up with this:
C:\Program Files\Adobe\Adobe Photoshop CC 2015\Presets\Scripts\myScriptFile.jsx
That is correct - my scripts are located in the main.jsx of my panel.
So I guess that the $.fileName function is rather dumb and not really working with panels. If this is indeed the case then is there another way of getting the path to the panel and/or script???
Also: I tried running alert($.fileName); in jsh* and then I got the correct path to the script So it appears that you only get this weird result when executing scripts from a panel.
Found the solution!
var csInterface = new CSInterface(); var extensionRoot = csInterface.getSystemPath(SystemPath.EXTENSION) + "/jsx/"; alert(extensionRoot);
Credits goes to Davide Barranca