1

I have about 200 folders with X images in each of them.

I have a master script in the root folder that does some stuff to the images.

Each folder has some variables specific to it and its contents.

I want my master script, when it parses folder Y, load some sort of a config file from within folder Y to get those variables, then when folder Z is to be parsed, load the config file from that one.

I know of #include "config.jsx" that I use at the moment to load it but its at the beginning of the script, I need something dynamic and doesn't need to be a jsx at all.

Discipol
  • 3,137
  • 4
  • 22
  • 41

1 Answers1

0

I store all my parameters in xml format and read that in using the XML objects in extendscript. As long as your parameters file is always named something like 'config.xml' it is easily located.

var file = new File( /c/folder/file.xml );       
file.open("r");
var str = file.read();
var xml = new XML(str);
Anna Forrest
  • 1,711
  • 14
  • 21
  • is it just javascript style loading and parsing of files or is it something special to Photoshop script? – Discipol Feb 14 '14 at 08:08
  • I believe the XML implementation is specific to ExtendScript?? Could be wrong, I don't do a great deal of JS outside of Adobe scripting. The doco for both the XML object and the file system objects are in the 'JavaScript Tools Guide' pdf. – Anna Forrest Feb 14 '14 at 14:33