Image Events scale and save

Many thanks in advice for help or advice given:

Im trying to Open images in Image Events one at a time from the (linkRefList) and Scale each image and save to a folder in the desktop (thisFolder), but my AppleScript keeps throwing up an error "Image Events got an error: Can’t get image “*******” error number -1728.

It does the first one then the errors…

on makeThumbnails(linkRefList, thisFolder)
	tell application "Image Events"
		launch
		repeat with this_Image in linkRefList
			set thisFile to (open this_Image)
			scale thisFile to size 50 --- wiil scale width or height, whichever is larger to 50
			save thisFile as PNG in thisFolder
		end repeat
	end tell
end makeThumbnails

Hi.

The paradigm when saving a document or image is that you’re saving it to a file, not to a folder. You have to provide the complete path to the file in the folder.

It’s a bit confusing here because you’ve labelled the file variable this_Image and the image variable thisFile. :slightly_smiling_face:

1 Like