I’d like to move a selection I made through the whole document by its width amount (var x2) relatively to its current position. It seems there was a translate function in earlier versions that did exactly what I want but this function now gives an “probably not supported in this version of Photoshop” error. I’m working in Photoshop Extended CS6.
This is the selection I have:
var x2 = 720;
var y2 = 350;
docRef.selection.select(Array (Array(0, 0), Array(x2, 0), Array(x2, y2), Array(0, y2)));
I tried to make an equation for that but all I get is garbage selections that aren’t even rectangular anymore.
I think the translate (in earlier versions) doesn’t work, or is now outmoded, as it’s point based, not pixel based.1 point = 4.86127 pixels
I tend to use this function for getting a rectangular or elliptical selection. I find it easier than having to define four limits (top, left, right, bottom) rather than four sets of x & y coords each time.
Hope this is helpful.