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

Remove hidden selected layers action/script?

Explorer ,
Nov 21, 2022 Nov 21, 2022

First I want to delete hidden text layers, but I think I need this more. I've already got the "Select all text layers" script, but when I push Delete hidden layers, it also deletes all other hidden ones (pixel layers, smart objects, shapes,...). Can you guys help me on this? Thank you very much!

TOPICS
Actions and scripting , Windows
1.0K
Translate
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
Adobe
Community Expert ,
Nov 21, 2022 Nov 21, 2022

It would probably help to share a link to the source code or to post the code with attribution here.

 

There is no connection between the menu item for Layer > Delete > Hidden layers and a separate different script to select only text layers. Here is the AM code for the command, there is nothing in there limiting it to text layers:

 

var iddelete = stringIDToTypeID( "delete" );
    var desc13 = new ActionDescriptor();
    var idnull = stringIDToTypeID( "null" );
        var ref5 = new ActionReference();
        var idlayer = stringIDToTypeID( "layer" );
        var idordinal = stringIDToTypeID( "ordinal" );
        var idhidden = stringIDToTypeID( "hidden" );
        ref5.putEnumerated( idlayer, idordinal, idhidden );
    desc13.putReference( idnull, ref5 );
executeAction( iddelete, desc13, DialogModes.NO );

 

Translate
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
Explorer ,
Nov 21, 2022 Nov 21, 2022

Sad to hear this, but thank you anyway. I'll probably continue to use filters and delete them manually. Have a nice day!

Translate
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
Community Expert ,
Nov 21, 2022 Nov 21, 2022
LATEST
quote

Sad to hear this, but thank you anyway. I'll probably continue to use filters and delete them manually. Have a nice day!


By @Junyi24858697x32l

 

I didn't say that it wasn't possible, just not possible the way you were trying to do it! :]

Translate
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
Community Expert ,
Nov 21, 2022 Nov 21, 2022

 

// EDIT: Original code removed, more work to be done!

 

Translate
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