要求を勘違いしてたけど、せっかく書いたので公開
表題の通り、Illustrator用のAppleScriptです。
選択した画像にマスクがあるなら、そのサイズでグレーの塗りのオブジェクトをつくります。
マスクがない場合はなにもしません。
回転には対応していません
tell application "Adobe Illustrator"
tell document 1
set selectList to selection
if selectList is not 0 then
repeat with theItem in selectList
my getPathItem(theItem)
end repeat
end if
end tell
end tell
on getPathItem(selObj)
tell application "Adobe Illustrator"
if class of selObj is group item then
set myCount to count page items of selObj
repeat with N from 1 to myCount
my getPathItem(page item N of selObj)
end repeat
else if class of selObj is path item then
my newRectangle(selObj)
end if
end tell
end getPathItem
on newRectangle(selObj)
tell application "Adobe Illustrator"
tell document 1
tell selObj
set geoBounds to geometric bounds
end tell
make new rectangle at beginning with properties {bounds:geoBounds, fill color:{cyan:0, magenta:0, yellow:0, black:30}}
end tell
end tell
end newRectangle
参考にしたサイトたけうちとおるのスクリプトノート