Adobe-Export-Scripts icon indicating copy to clipboard operation
Adobe-Export-Scripts copied to clipboard

layer position i am not getting extract position from psd

Open mraj32 opened this issue 9 years ago • 6 comments

Script is working fine for image coordinates but When i try to extract the layer position i am not getting extract position from psd. can you help me getting correct data from psd. attached is the value expected'default text layer' as 43, 60.77 but i am getting different position. Advance thanks

capture

mraj32 avatar Sep 08 '14 11:09 mraj32

Hi @mraj32, what is the incorrect number you're seeing on output?

bronzehedwick avatar Sep 15 '14 13:09 bronzehedwick

I believe you have to rasterize all layers and layer effects to get the most accurate results.

aziznatour avatar Oct 14 '16 09:10 aziznatour

@bronzehedwick This script is awesome !

But I confirm the issue. The problem is that layerRef.bounds[0].value; only returns position of first pixel, it exclude a part of the layer (that you can see if you hit the Transform button.

demo

To reproduce you can create a smart object, and put a small rectangle inside it.

You will see that exported data match the layer box, but not the layer transform box (which have the initial placement of our image).

It would be nice if you can take a look, it seems that a solution is not as straightforward 😄

X-Raym avatar Feb 21 '18 09:02 X-Raym

@X-Raym Thanks! And thanks for bumping the issue: I haven't had much time to work on this, but hopefully I'll be able to address this in the next few days.

bronzehedwick avatar Feb 21 '18 15:02 bronzehedwick

@bronzehedwick No problem ! Thanks for your quick answer ! The issue was also in the Photoshop API iteself, but r-bin made a script that overcome that: https://forums.adobe.com/thread/2455423

There is a script function which solves this, maybe you will need to do that in a very different way, but maybe it can help a bit.

X-Raym avatar Feb 21 '18 20:02 X-Raym

Thanks!

bronzehedwick avatar Feb 21 '18 21:02 bronzehedwick