画像の縦長横長を見てフォルダ仕分け
1つのフォルダに入っている画像を、画像サイズを取得して縦長か横長かを判定して、それぞれのフォルダに仕分けします。
| スクリプト名:画像の縦長横長を見てフォルダ仕分け |
| set a to choose folder with prompt “画像フォルダを選択“ tell application “Finder“ set allF to every file in a end tell set b to choose folder with prompt “出力先フォルダ(縦)を選択“ set c to choose folder with prompt “出力先フォルダ(横)を選択“ tell application “Image Events” to launch repeat with i in allF set j to i as alias set bb to retDirectionOfImage(j) of me if bb = false then tell application “Finder“ move i to b end tell else tell application “Finder“ move i to c end tell end if end repeat on retDirectionOfImage(aFile) tell application “Image Events“ activate set this_image to open aFile set {aWidth, aHeight} to dimensions of this_image close aFile end tell if aHeight > aWidth then return false –縦 else return true –横 end if end retDirectionOfImage |
