문제

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.

도움이 되었습니까?

해결책

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);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top