Hello,
I'm working on a script that loads and saves its setting from and to an XML file. This file is supposed to be located in the same folder as the script. In my case this is the Scripts-Folder in Photoshop.
Sometimes I had issues with the script not finding the XML file although the source code was the same as always. My question is, how I'm supposed to formulate the path of the File command so that the script will always find the XML file in the same folder.
So far my path was used like this ... (although this caused the problems then and now).
var f = new File("./Presets/Scripts/Settings.xml");
Thanks for all the help,
Andreas
Path to XML file
-
Mike Hale
Path to XML file
If I understand what you are asking, use the full path when creating the file object.
Code: Select allvar scriptsPath = app.path + "/" + localize("$$$/ScriptingSupport/InstalledScripts=Presets/Scripts");
var f = new File(scriptsPath+"/Settings.xml");
Code: Select allvar scriptsPath = app.path + "/" + localize("$$$/ScriptingSupport/InstalledScripts=Presets/Scripts");
var f = new File(scriptsPath+"/Settings.xml");
-
Gonzaga
Path to XML file
Thanks Mike,
that did the trick. I hope this is platform compatible so it will work on Mac and PC.
Cheers,
Andreas
that did the trick. I hope this is platform compatible so it will work on Mac and PC.
Cheers,
Andreas