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

Get all selected layers?

Contributor ,
Sep 29, 2016 Sep 29, 2016

Pretty straightforward question.

If I wanna perform an action on mutliple layers then I first need to get all the selected layers in a document - but how do you do that?

TOPICS
Scripting
495
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
Engaged ,
Sep 29, 2016 Sep 29, 2016

Hi, Heimdaal!

Even if you select multiple layers, you can get only one. You can get only the last selected layer (the layer on which was the last click). Something like this.

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
Contributor ,
Sep 29, 2016 Sep 29, 2016
LATEST

That is very unfortunate... and very dev-unfriendly... Makes you wonder what the heck they were thinking when creating ExtendScript.

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
Valorous Hero ,
Sep 29, 2016 Sep 29, 2016

You can record and load/play an action which does the "Hide Others" inside the layers panel. By taking a measure of the visible vs hidden layers before and after this action is ran, you can tell which the selected layers are. Of course, this won't help if some of the selected layers are already hidden. In fact, the action fails if there are any hidden layers selected and this command is used.

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