Original posts: Photoshop: Select item and crop it directly
I tried asking on the original post, but it says I need 50 comments or participations to post a comment. Sorry for the confusion.
I was trying the method below from Alan G in the original post:
If you're asking about cropping an individual object on a layer, then no, there's not a direct way to do that. Photoshop crops the entire canvas, not individual layers. There are indirect ways, though, both of which you can make into a one-click Action.
Ctl-click on the layer thumbnail in the Layers Panel to create a selection of just that >object.
Click the Layer Mask icon at the bottom of the Layers Panel to create a mask that reveals >only the object.
Unlock the mask from the layer (click the chain-link icon between the thumbnail and the mask.
With the mask selected (not the pixel layer), press Ctl-T to enter free transform mode.
Your free transform will now act like a crop mask for the layer.
One time it worked. Every time I try it again I get an error: "Could not transform because the initial bounding rectangle is empty". What am I missing?