Hi all
How do you resize a file proportionally in PS7? I can resize the file by a hardcoded width and height but how do I resize the width to 300px and have the height automatically resized proportionallly. And is PS the right tool for doing this in?
There are many other tools to do this, but here’s a PhotoShop method.
set AppleScript's text item delimiters to ""
set DesiredRez to 300 as real
tell application "Adobe Photoshop 7.0"
activate
tell current document
set InitialDocWidth to width as inches
set InitialDocHeight to height as inches
set InitialDocRez to resolution
--it depends on whether you want to resample the document as to what to do next
--many possibilities exists by grabbing the Initial stuff and doing a little math
set DaDialog to display dialog ("The file is currently: " & return & return & ¬
((InitialDocWidth & " x " & InitialDocHeight & " @ " & InitialDocRez) as string) & return & return & ¬
"Should I re-sample the file?") buttons {"Cancel", "Don't Resample", "Resample"} default button 3
if button returned of DaDialog is "Resample" then
resize image of it width (InitialDocWidth as inches) ¬
height (InitialDocHeight as inches) ¬
resolution DesiredRez resample method bicubic
else
set InitialDocWidth to width as pixels
set InitialDocHeight to height as pixels
resize image of it width (InitialDocWidth as pixels) ¬
height (InitialDocHeight as pixels) ¬
resolution DesiredRez resample method bicubic
end if
end tell
end tell
Hope it helps
Jeff Case