Nice of you to post a screenshot but please post a meaningful screenshot that includes the pertinent Panels.
Are you talking about a Shape Layer for example?
Thank you for the prompt response.
Please find the meaningful screenshot below.
I need to get the cornerpoints value from the selection.
if I use activeDocument.selection.bounds code, It is show as 0,100 for topLeft.
However I need to get the value (100,145) instead of (0,100) viceversa for all sides.
Could yoy please share your suggestion.Inputs?
You misunderstood – the screenshot fails to illustrate if the blue shape is a Shape Layer or something else.
With a Shape Layer the issue could simply be addressed by getting the PathPoints’ coordinates.
Other things (a pixel Layer of the object, the object just pixels on a larger Layer, …) would necessitate other approaches.
It is a pixel layer not a Shape Layer.
And is it definitely always going to be a four sided shape?
So that there is always only going to be one extreme point in all four directions?
Can there be cases where one or more sides may be perfectly vertical or horizontal?
What is this about anyway? Is it a task that arises often enough that it’s worth automating?
I can’t remember who posted it but in a recent thread someone provided a neat solution by, if I remember correctly, evaluating the bounds and then intersecting row/column selections with the original selection an the four extremes.
Those resulting four selections can then be evaluated to get the »missing« coordinate for all four extremes.
Another approach would be creating a Working Path from a Selection based on the Layer’s transparency and evaluating that path.
Thank you for your detailed explanation.
I'm bit familiar with both DOM and AM code.
I'll try with work path method and let you know how it is working.
Depending on the Selection and the Working Path settings the resulting Path may have a lot of »useless« points, so filtering out the corner points might be an interesting challenge.
Thank you for sharing the idea. My work path is very simple with 4 nodes.
I consider each point as a corner and your Idea working like charm.
Thank you so much.