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

このエントリーをはてなブックマークに追加
358名称未設定
お題 http://hibari.2ch.net/test/read.cgi/mac/1281949690/615
1. OSX10.6
4.jpegを放り込むと黒フレームを入れて保存される。
できれば初期設定のみでサクッと変換するドロップレット系が希望。

下記をアプリとして保存。作成、確認は10.4.11だけどw

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
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