Layer properties not being retrieved in Javascript
I'm writing a javascript to compile a bunch of files together. It works like this:
Get list of files and corresponding list of layers (one layer from each file, if you want multiple layers from the same file, list the file twice)
|
Open up files
|
Get list of top level layers in file and print an alert
|
Find layer with same name as layers and copy contents of layer into a new file
|
Close file
|
Repeat
It works very well when the list of files is small, but when I get to about 4 or 5, something seems to break. When I open up the file, I print the layer array contents and compare it to what I know the layers to be. When the script is about to break, I get something that looks like this:
Where one of the layers doesn't have properties. It hasn't got a name or an array of children layers. It's not the fault of the file, since if I do a short list it works fine. If a run works with a certain number of files, and I duplicate the last set (so the last file/layer combo is repeated) it will fail when it repeats.
Has anyone ever come across a problem like this before, or have an idea about why it is happening?