• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Identify smart objects from libraries

New Here ,
Nov 04, 2020 Nov 04, 2020

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.

jonatans92775995_0-1604494403285.png

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!

TOPICS
Actions and scripting

Views

184

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 04, 2020 Nov 04, 2020

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.

Votes

Translate

Translate
Adobe
LEGEND ,
Nov 04, 2020 Nov 04, 2020

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines