title: Photoshop move layer along y-axis
body: <p>I'm working on a script that will move a layer, right, left, up, or down. This depends upon which edge of the layer is inside the canvas.</p>
  
  <p>I've managed to get the layer moving left and right (x-axis) using bounds[0] and bounds[2]. </p>
  
  <p>But when I try to get it to move up or down, it still moves left/right. Is it the bounds number I've got wrong?</p>
  
  <pre><code>var Y1 = bounds[3].as('px');
  var Height = app.activeDocument.height.as('px');
  
  //move down
  if (Y1 &lt; Height) {
  activeDocument.activeLayer.translate(Height-Y1); 
  }
  </code></pre>