Hello all. I'm developing a script for Photoshop CS3 that exports the layers of a psd to a readable format for my company's 3D application, and everything has gone well until now that I need to convert the .js to .jsxbin so no one can see the code (well, I know it wouldn't be difficult to hack that).
The problem is this: imagine that my script's name is "myscript.js" and it has a directory "myscript" with some files I need during the exporting process (mostly images that I put in the dialog). When I was executing it as a .js, the path of the "scripts" folder was easily found this way:
var path = $.fileName.substring (0, indexOf(".")) + "/";
This returns "C:/<<adobe photoshop scripts path>>/myplugin/".
However, when I use ExtendScript to export it as binary, that line returns an empty string, like it didn't recognize the dollar ($) object. What I've tried after that is this:
var path = Folder.current + "/myplugin/";
This returns the same path but, again, only when executing the script as a .js. If I export it to jsxbin, the Folder.current is not being searched when running the script (which should be the correct thing) but is saved in the binary conversion, so it saves the path of my workspace and that's what is always shown from wherever I execute it (another directory, another machine). I hope I explained well this last step (if not, please advice).
Is there a way to solve this problem? I've run out of ideas 😞
Thanks beforehand.