Set visibility and select sublayers via CSV
Hey All,
I've previously asked this with objects and it works, but I have since realized that layers & sublayers are the better way for me to do this as I need to create clipping masks using the selections. I'm using Illustrator CS6 and a mac.
I need to figure out how to load and select a specific column from the CSV to set visibility of and select specific sublayers.
CSV File: printfile.csv
For artboard Front:
-Show only the sublayers found in the csv column “frontVisible” , each of the sublayers are listed in a cell separated by a comma ,
-Once visibility is set, I need to select 1st & 2nd array items. I will run a resize script below from Jduncan and then I would like to select all of the visible layers in the artboard so I can create a clipping mask.
I've tried a few different ways to load the data from the csv and I am doing something wrong because it does not work. here is one that I have tried.
function select () {
var doc = app.activeDocument;
var outlinesFrame = app.activeDocument.layers.getByName("frontVisible");
var outlinesArray = outlinesFrame.contents.split(/,/g);
for(i=0;i<len;i++)
{
lay= app.activeDocument.layers.getByName("frontVisible");
lay.hasSelectedArtwork=true;
}
}
select();
Any help would be appreciated.
Thanks!
