JSFL: How to select all library PNGs and set compression type to lossless/no smoothing?
Hello, I'm currently trying to figure out a way to make a command that selects all the PNGs in the library, and then changes the properties of those to compression lossless/no smoothing. This is what I've cobbled so far, however it selects all items as I'm unsure what the syntax would be to specifically ask for PNGs to be selected only (or wouuld it be bitmaps?).
var lib = an.getDocumentDOM().library;
fl.getDocumentDOM().library.selectAll(true);
for(i=0;i<lib.items[0];i++)
{
if(selected.indexOf(i)!=-1)continue;
else lib.setItemProperty('allowSmoothing', false);
lib.setItemProperty('compressionType', 'lossless');
}
I'm unsure how to address the syntax to be more specific. I've tried
fl.trace(fl.getDocumentDOM().library.items[0].itemType);
though I kept getting "folder" appearing in the output instead, haha.
If someone could lend me a hand figuring this one out, would be grateful. Thanks!
