【发布时间】:2015-03-18 05:03:08
【问题描述】:
我正在尝试使用下面的代码在 Applescript 中制作一个 droplet 脚本。
我有一个处理程序,它使用所选文件的 POSIX 路径运行命令行。
当我运行脚本时,一切正常(我的命令行处理程序工作正常)。但是,如果我将文件放到我的脚本中,什么都不会发生。
我需要帮助
on run
set thePath to POSIX path of (choose file of type "img" default location (path to downloads folder from user domain))
doIt(thePath)
end run
on open myImageFile
tell application "Finder"
if (count of myImageFile) is greater than 1 then
display alert "A message" as critical
else if name extension of item 1 of myImageFile is not "img" then
display alert "A message" as critical
else
set thePath to POSIX path of item 1 of myImageFile
doIt(thePath)
end if
end tell
end open
【问题讨论】:
标签: applescript