use AppleScript version “2.4” — Yosemite (10.10) or later
use scripting additions
on open fileList
repeat with thisFile in fileList
—do your stuff
end repeat
end open
on run
tell application “Finder”
set fileList to the selection as alias list
end tell
tell me to open fileList
end run
Источник: www.reddit.com _Мета слова: _