AppleScript アップルスクリプト 質問、発表 4

このエントリーをはてなブックマークに追加
359358
>>358
修正(tell application "Image Events" to launchの行を加える)

on open someFiles
set folderName to "Padded Images"
set destFolder to (path to desktop as string) & folderName
tell application "Finder"
if not (exists destFolder) then
make new folder with properties {name:folderName}
end if
end tell
tell application "Image Events" to launch
repeat with aFile in someFiles
tell application "Image Events"
set anImage to open aFile
tell anImage
set {origWidth, origHeight} to dimensions
pad to dimensions {origWidth + 20, origHeight + 20}
end tell
save anImage in file (destFolder & ":" & name of anImage)
close anImage
end tell
end repeat
end open