Suppose I press U/P to invoke the line tool/pen tool and I make a single line segment. How do I retrieve the coordinates of the endpoints of the line segment?
I know that I can select the layer with the line segment on it and do:
const app = require('photoshop').app;
let bounds = Object.values(app.activeDocument.activeLayers[0].bounds);
However, the bounds do not tell me the orientation of that line segment (does it slope upwards or downwards from the left?)
How do I actually access the coordinates of the line segment?
but I’m not sure how this data would be fed into something I can manipulate. This feels like a basic question, and I thought I collected notes on this, but I cannot find any information on it.
Thanks for the link. That’s actually what I used to retrieve the batchplay descriptor. What confused me was putting it in a function. What I ended up doing with the “get” basic event descriptor from the previous post (as per your suggestion to, specifically, look at the code tab, which helped a lot) was destructuring the output like this:
then I was able to access the coordinates you mentioned via, for example: layerInfo.keyOriginType[0].keyOriginLineStart.horizontal
which should return a number.
Thanks for that suggestion! That let me consolidate some functionality instead of relying on the layer bounds. This even exposes more properties that a line layer would have, letting me put the function behind some checker to make sure that the right kind of layer is selected.