Skip to main content
Participant
July 31, 2025
Answered

i need help in creating a photoshop script.

  • July 31, 2025
  • 1 reply
  • 134 views

i work in a retoucher environment for a large company. we get in product files as layerd .tif files. we have to put them on a 2000x2500 pixel jpg. the issue is, i need the top of the product to be a uniform distance from the top of the document and maintaini its proportions and positioning. some of the files have a transparent image lavey, a shadow layer with mask below that, a color fill layer below that, and an unused layer at the bottom. another variation is the have the top product layer in a group and the rest is the same .
Ive. been using a few AI tools and the path weve gone down is to
1. Resize the image to 2000x2500 if needed
2. Merge anything above the color fill layer, 
3. drop a horisontal guide at 675px (we havent determind the proper height we would need yet)
4. move the top of the product to meet the guide
5. Flatten and export or just export as aJPG

we tried flattening the image first, creating a new document pasting it in, and doing the remaining steps but cant seem to get it quite right. 

 i ould do it withan action, but dont know any way to find the top pixels of the product and bring it up to the guide or to a specific distance from the top
I am open to using separate scripts f need be. we process over 30k documents per year and if i can get this piece automated, it would be a huge help. any scripts gurus out there able to help me??

Correct answer Stephen Marsh
quote

 i ould do it withan action, but dont know any way to find the top pixels of the product and bring it up to the guide or to a specific distance from the top


By @mrearly2801

 

In an acton, record the select all command, then with the move tool, you can use the align button in the toolbar to move it to the top of the selection, which would be the top canvas edge, then deselect. Then you can then move/transform down the required distance from the canvas top. Depending on the content, this may or may not be 100% but should get you close. Scripts would likely have the same challenges if the top pixel edge was offset be a glow or shadow etc.

1 reply

Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
July 31, 2025
quote

 i ould do it withan action, but dont know any way to find the top pixels of the product and bring it up to the guide or to a specific distance from the top


By @mrearly2801

 

In an acton, record the select all command, then with the move tool, you can use the align button in the toolbar to move it to the top of the selection, which would be the top canvas edge, then deselect. Then you can then move/transform down the required distance from the canvas top. Depending on the content, this may or may not be 100% but should get you close. Scripts would likely have the same challenges if the top pixel edge was offset be a glow or shadow etc.