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

Adobe ExtendScript get array of manual selection

Community Beginner ,
Dec 25, 2023 Dec 25, 2023

I am using 

app.activeDocument.selection

 

This includes an array of my selection, however indexed based on the selected layers from top(index = 0) to bottom (index = app.activeDocument.selection.length - 1).

 

What I would like to have is the order of my manual object / layer selection. Is this possible?

TOPICS
Feature request , How-to , Scripting , Third party plugins , Tools
446
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
Guide ,
Dec 25, 2023 Dec 25, 2023

Do you mean the order in which the items were selected (which item was selected before/after which)?  If so, no, it's not possible. 

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 Beginner ,
Dec 25, 2023 Dec 25, 2023

Hey there 👋

yes correct, that would be required. Still many thanks for your quick response 👍

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 ,
Dec 25, 2023 Dec 25, 2023

I think you would need the SDK to do that. 

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
Guide ,
Dec 25, 2023 Dec 25, 2023

You can watch selection changes with the "afterSelectionChanged" handler.

Create a shadow variable starting from the previous selection.

Push newly added items (to back), and remove those removed items.

You'd do this for each separate window (the event target).

 

Layer selections? Panel selections e.g. in the layers panel are not exposed. You'd need a plug-in for that.

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
Guide ,
Dec 25, 2023 Dec 25, 2023

Ouch, above applies to InDesign, I did not realize that this discussion is about Illustrator. 

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 ,
Dec 25, 2023 Dec 25, 2023

Haha, I make that mistake regularly! Nice to see I'm not alone. 🙂

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 Beginner ,
Dec 25, 2023 Dec 25, 2023
LATEST

Oh I see, still many thanks to both of you ☺

As of now, it isn't tragic, would simply have been an additional nice to have. However, I edited the setAllThings script from Wundes to copy all four transform settings (x,y, width, height) of a specific object / layer to all other selected one's.

 

This anyway, isn't a use case I encounter very often, therefore I am fine that I at least orientate myself on the most upper layer as the origin for the transform values to be copied.

 

Many thanks to all answerers and Merry Christmas 🎅

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