I’m having difficulty getting Image Capture to open a file. I would like Image Capture to open a JPEG, and just scale the image down to another size, which I know is very much possible, based on Apple’s page at: http://www.apple.com/applescript/image_capture/
First a question: Does Image Capture care about the original file’s type and creator? For example, I have a bunch of images I made in Photoshop. When I tell Image Capture to open this folder of images, Photoshop launches instead. I changed the images to what I hoped was a neutral type and creator (type: JPEG, creator: ogle) and this time Preview opens instead.
I’m not expecting any applications to open except Image Capture Scripting.
If your code is opening PS or Preview, most probably is wrong. Try this one instead:
set theImg to alias "path:to:image.jpg"
tell application "Image Capture Scripting"
set x to (open theImg)
scale x to size 250
save x in theImg
close x
end tell
Hi JJ -
Thanks for the response. That script you provided worked great. What if I wanted to repeat that command on a series of files in a folder, instead of just one file? I tried combining your code with a repeat loop that I had, but I am getting execution errors:
set imageSource to "disk1:Users:downsizing:Desktop:batch:images:"
tell application "Finder" to set imgList to get every file of folder imageSource
repeat with theImg in imgList
tell application "Image Capture Scripting"
set x to (open theImg)
scale theImg to size 280
save x in theImg
close x
end tell
end repeat
Any help would be greatly appreciated. Thanks again!
set imageSource to "disk1:Users:downsizing:Desktop:batch:images:"
tell application "Finder" to set imgList to get every file of folder imageSource as alias list
repeat with theImg in imgList
tell application "Image Capture Scripting"
set x to (open theImg)
scale x to size 280
save x in theImg
close x
end tell
end repeat
At least in my machine, Image Capture Scripting is a crap piece of software, and it allways stops working after processing 20 or 30 images. I develope/d a little app using it, and my most common reported bug, through an AppleScript Studio interface, was “Connection is invalid”, which usually means that you are passing the wrong data. which usually means that ICS is buggy.
If you are planning process lots of images, I still would recommend Imagemagick!