4 Replies Latest reply on Feb 14, 2018 2:33 PM by UltimatePeter

    Help: Script / Action that re-positions layer to horizontally center on certain X coordinate.

    UltimatePeter

      Okay, so I already have a script that resizes my layer correctly, now I need to duplicate it, and the center of each of those two layers needs to end up at 585px and at 2118px.

       

      I recorded an action to duplicate and move, but it is a relative move. The graphic in question is not always the same size, so it ends up in different places sometimes.

       

      What I need to do is reposition the center of each layer to those X coordinates. Or, if we just focus on one at a time, as a test case, I would need to reposition layer one's center to 585px.

       

      I think I have seen in some scripting that you can get the left side coordinate and right side coordinate of your layer. I would imagine we could use those to calculate where the center is, and then use the original position to calculate a relative move to 585?

       

      Any help would be awesome!