Finding the dimensions of a smart object, even when the smart object contains negative space...
Hi all,
I'm trying to find the true dimensions of a smart object layer in Photoshop... The following piece of applescript works as long as there is no negative space in the smart object. If there is negative space, the following is no longer accurate. You can click on the layer and it shows what the below applescript is seeing, however, clicking on a corner of the layer can sometimes reveal more than what is being shown originally.
tell application "Adobe Photoshop 2023"
tell current document
set smartObjectDimensions to bounds of current layer
set smartObjectWidth to (item 3 of smartObjectDimensions) - (item 1 of smartObjectDimensions)
set smartObjectHeight to (item 4 of smartObjectDimensions) - (item 2 of smartObjectDimensions)
end tell
end tell
Any help would be much appreciated!
Cheers,
Sam
