Crop from selection in batch

Upload Photoshop Scripts, download Photoshop Scripts, Discussion and Support of Photoshop Scripts

Moderators: xbytor, DavideBarranca, Paul MR

Posts: 1
Joined: Thu Mar 16, 2017 8:07 pm

Crop from selection in batch

Postby tweedceretops » Thu Mar 16, 2017 8:15 pm

Hi everyone-

I have what I think is a relatively simple problem that I can't solve on my own (i'm not great at writing my own scripts):

I have a folder of images (products on white) that I need to crop to a square. What I want to do in the script is:

1 - Load the path for image "A" to a selection
2 - Crop (without deleting pixels) based on the selection from step 1
3 - expand the canvas by 10% (to give a little breathing room)
4 - Using expand canvas, match the short dimension to the longer one.

Basically the end result is the masked layer in the center of a square document...

I've got steps 3 and 4 good to go, the problem I'm having is that I can't figure out how to load the selection and use that as the guide for the crop in the context of an action or script. When working on a document one by one, you can load the selection, hit the crop tool, and then the crop box snaps to that selection.

Hopefully someone can give me a hand!

Return to “Photoshop Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest