Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Cooknn

macrumors 68020
Original poster
Aug 23, 2003
2,111
0
Fort Myers, FL
I've got an Applescript that rotates my photo's counter clockwise 90°, but there is a slight problem with it. Problem is that if I drag my images to the script I get the error The variable theImage is not defined. I can press Edit or OK. If I press Edit then compile and save I can drag and rotate my pictures fine. But I always have to edit/compile/save first.

Could use some help. Code below.
Code:
on open theFiles
	
	set theFiles to theFiles as list
	
	repeat with aFile in theFiles
		
		set aFile to aFile as alias
		
		tell application "Image Events"
			set theImage to open aFile
			rotate theImage to angle 270
			save theImage in aFile
			close aFile
		end tell
		
	end repeat
	
end open
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.