Question

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.

Was it helpful?

Solution

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);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top