I have a simple script that pulls in a layer set from another open image, resizes, and moves the layer to the bottom right of the image. Logo branding for photography, basically. Seems to work fine in CS6 and most older versions, but does not work in the latest 2015 version of Adobe Photoshop CC.
The hitch seems to be the positioning of the layer, as the logo is going where it's supposed to when working, but when not, moved exactly to 0,0 coordinates. Has something changed in the new version that would make the following code incompatible? What am I missing?
var leftOffset = ((docWidth * .97) - logoWidth) var topOffset = ((docHeight * .97) - logoHeight) var newX = new UnitValue(leftOffset,'px'); // the x pos to move the layer to var newY = new UnitValue(topOffset,'px'); // the y pos to move the layer to var offsetX = new UnitValue( newX - currentBounds[0].as('px'), 'px'); // the required offset needed for move var offsetY = new UnitValue( newY - currentBounds[1].as('px'), 'px'); // and the y logoSet.translate( offsetX, offsetY ); // move the layer