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

Copy link to clipboard

Copied

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

Views

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

Copy link to clipboard

Copied

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. 

Votes

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

Copy link to clipboard

Copied

Hey there 👋

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

Votes

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

Copy link to clipboard

Copied

I think you would need the SDK to do that. 

Votes

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

Copy link to clipboard

Copied

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.

Votes

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

Copy link to clipboard

Copied

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

Votes

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

Copy link to clipboard

Copied

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

Votes

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

Copy link to clipboard

Copied

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 🎅

Votes

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