Copy link to clipboard
Copied
Hi everyone,
I'm writting a script that iterates through all the layers and gathers information about them (name, text, size...). The script automatically opens smart objects and gathers information from the layers inside.
Most of the time the script works just fine but it can get stuck when trying to open smart objects that are linked to libraries. Even if I have access to those libraries.
This is the code that I'm using to open the smartobjects
function openSmartObject (layer)
{
try
{
executeAction(charIDToTypeID('Invs'), undefined, DialogModes.NO);
app.displayDialogs = DialogModes.NO;
var doc = app.activeDocument;
doc.activeLayer = layer;
var idplacedLayerEditContents = stringIDToTypeID( "placedLayerEditContents" );
var desc5796 = new ActionDescriptor();
executeAction( idplacedLayerEditContents, desc5796, DialogModes.NO );
}
catch(e)
{
return false;
}
}
Is there a way to identify layers from libraries so I avoid opening them?
If not, is there a way to avoid those popups that blocks the execution of the script?
I've already tried displayDialogs = DialogModes.NO; and it doesn't work.
Thanks in advance!
Find on the forum how to use 'smartObject' and 'smartObjectMore' properties, thanks to which probably you can check if SO is linked to library, otherwise you can parse PSD binaries to look for this information.
Copy link to clipboard
Copied
Find on the forum how to use 'smartObject' and 'smartObjectMore' properties, thanks to which probably you can check if SO is linked to library, otherwise you can parse PSD binaries to look for this information.