How to know X, Y here(Transfom Panel) of selected items by ExtendScript?

Community Beginner ,
Apr 12, 2022 Apr 12, 2022

Copy link to clipboard

Copied

James23069990fqkl_0-1649767725441.png

 

TOPICS
How to , Scripting , SDK

Views

85

Likes

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
Adobe Community Professional ,
Apr 12, 2022 Apr 12, 2022

Copy link to clipboard

Copied

alert (app.activeDocument.selection[0].position)

 

will give you the top left position of the selected item - but always in points and with negativ Y-value

Likes

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
Community Beginner ,
Apr 14, 2022 Apr 14, 2022

Copy link to clipboard

Copied

When I select the whole layer 

layerSM.hasSelectedArtwork = true;
If there are clipping mask in the layer, then I can't get correct position using your method..
 

Likes

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
Adobe Community Professional ,
Apr 12, 2022 Apr 12, 2022

Copy link to clipboard

Copied

For multiple objects that are not grouped, the script cannot simply ask for the answer.
The “position” property always returns the coordinates of the path. It does not take the stroke width into account.
Conversely, the “top” and “left” properties always return the coordinates outside the stroke width.

Likes

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
Adobe Community Professional ,
Apr 14, 2022 Apr 14, 2022

Copy link to clipboard

Copied

LATEST

 

Sorry, but this was not your question. My snippet is one possibility that gives you X, Y (Transfom Panel) of selected item by ExtendScript. That was your question:

How to know X, Y here(Transfom Panel) of selected items by ExtendScript?

pixxxelschubser_0-1649931707402.png

 

James23069990fqkl_0-1649767725441.png

 


By @James23069990fqkl

 

 

For e better answer explain a bit more in detail what you have and what you want. Screenshots and/or example files are helpful.

 

Likes

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