1 person found this helpful
Before you crop the layer you can use the layer bounds to get the x, y position...
Make sure ruler units are set to pixels.
var LB = activeDocument.activeLayer.bounds;
var x = LB.value;
var y = LB.value;
These values can then be written to file.
This is one of the most important pieces of script I was looking for! Thanks Paul.
Is it possible to set the ruler units to pixels within the script itself just to be 100% safe?
Now I need to know how to loop through all layers and set the layer active & it's done!
You can set the ruler units then restore them back to what they were...
var startRulerUnits = app.preferences.rulerUnits; app.preferences.rulerUnits = Units.PIXELS; //code here app.preferences.rulerUnits = startRulerUnits;
For selecting all layers, see ..
Maybe you could modifiy it to add your own features?
Great info Paul!
The script does everything I need, I just have to findthe right place where to add the x & y positions and save it to a file!