Illustrator Script checking object visibility
I'm working on building a document where it's content and images are imported from a CSV file. I'm then using a second script that I am writing to format that content and export a PDF. As part of my formatting script, I need to check to see if an imported image is set to visible or not.
Here is how I'm targeting/accessing my imported images in the script:
var doc = app.activeDocument;
var _pageItems = doc.pageItems;
var ImgItems = [];
var j = 0;
for (var i = 0; i < _pageItems.length; i++) {
if (_pageItems[i].typename == "PlacedItem") {
ImgItems[j] = _pageItems[i];
j++;
}
}
img1 = ImgItems[0];
img2 = ImgItems[1];
img3 = ImgItems[2];
img4 = ImgItems[3];
What I need to do, is check to see if img3 is visible or not. I've found some documentation on checking the layers visibility, but I can't seem to get that to work for me.
All help is appreciated. Thank you.
