I’m not knowledgeable about Applescript, but need to use it in order to convert uploaded images on a Webserver. Am using GraphicConverter to do the image manipulation. Want to convert any image that is uploaded to two versions - one 280 pixels width and the second 100 pixels wide.
Have this code… which does work
tell application "GraphicConverter PPC"
(activate)
(open "G4-1:desktop folder:photo_drop_box:uploadedimage.jpg")
get image dimension of window 1
set wide to item 1 of result
set scale_factor to (280 / wide)
scale window 1 horizontal scale_factor vertical scale_factor
save window 1 in "G4-1:desktop folder:photo_drop_box:uploadedimage_280.jpg" as JPEG
get image dimension of window 1
set wide2 to item 1 of result
set scale_factor2 to (100 / wide2)
scale window 1 horizontal scale_factor2 vertical scale_factor2
change colors window 1 to bit depth "16"
save window 1 in "G4-1:desktop folder:photo_drop_box:uploadedimage_100.jpg" as JPEG
close window 1 without saving
end tell
… but the problem is that I need to convert the script to apple_events for use by our app server and want to stipulate an exact pixel width rather than a scale factor, as outlined in the code above… I can’t see anywhere in the GC library that I can stipulate a specific width for an image… other than to scale with factors… is this true?
Any insight - much appreciated.