Align layer to x, y position relative to another layer's coordinates using Photoshop Script.
Attempting to create an automated task for jpg batch processing using Actions, but so far was unable to automate alignment of a layer (it's reposition) relative to another layer's coordinates, which is necessary for subsequent actions to be carried out properly.
Problem is as follows:
As is apparent in the video, there are five layers, names of which are all universal in all files seeing as their naming is done via Actions, though only the top three are of importance to the subject in question, those being, from top to botom:
IsolatedCentered
Isolated
OriginalLayer
The task is to input x, y positional values for OriginalLayer that are result of distance between the other two layers and therefore can also be acquired by subtracting x and y coordinates of Layer Isolated from layer IsolatedCentered.
Imagining it would go something along the lines of:
#target photoshop
...
OriginalLayer (x) = IsolatedCentered (x) - Isolated (x)
OriginalLayer (y) = IsolatedCentered (y) - Isolated (y)
although, in JavaScript syntax of course, however, as the case is currently such that time is in short supply and not substantial enough amount of it can be put towards getting into the subject of coding in JavaScript, but since the task seems it would be only as big as 20 lines of code, if that, hopefully the question will come across the line of sight of someone that has enough Photoshop scripting skill necessary for it, preferably in JavaScript. If inconvenient, seeing as the task is being carried out Windows machine, VBS is an option as well.
Thanks in advance.
P.S.
Reason for turning to scripting in Photoshop is, at least as far as current awareness of capabilities of Photoshop tools, there is no way currently known by which the necessary operation can be accomplished by those means.
Align tools don't work as the center of the layer that is to be moved is already at the center of the canvas, and locking the reference layer disables the tool set, rendering it useless.
Also tried, Auto-Align Layers, however, unlike inputing x and y coordinates manually, that one does not align to pixel level accuracy.
After a few days of roaming the Photoshop related forums and how-to sites in search of the script, or parts of multiple ones that could be put together, since no suitable code has been found so far, not a small factor in which being that Javascript sklls are currently on beginner level, at best, having just become aware of Photoshop Scripting, and the fact that they can be Macro recorded (as an Action), this currently seems like the only solution left, that is, looking for the answer to the problem by means of asking specifically.
