Hello,
based on this thread http://bbs.applescript.net/viewtopic.php?id=14167
I have this snippet that gives an error “Finder got an error: item 1 of {document file “ati-x800.jpg” of folder “Pictures” of folder “holbrook” of folder “Users” of startup disk} doesn’t understand the scale message.”
I know it must be something stupid I am doing.
Here is the script:
property theSize : 0.5
tell application "Finder"
set theFiles to selection
end tell
if (count of theFiles) is not 0 then
repeat with theFile in theFiles
tell application "Image Events"
launch
open theFile
scale theFile by factor theSize
save theFile
close theFile
end tell
end repeat
end if
If I change it to
property theSize : 0.5
tell application "Finder"
set theFiles to selection
end tell
if (count of theFiles) is not 0 then
repeat with theFile in theFiles
tell application "Image Events"
launch
set theImage to (open theFile)
scale theImage by factor theSize
save theImage in theFile
close theImage
end tell
end repeat
end if
Then I get the Applescript Runtime Error “the variable theImage is not defined” on the “scale” line.
Can anyone see where I screwed up here? Thanks!!!