【发布时间】:2017-08-05 16:56:28
【问题描述】:
我希望在打开程序时显示警报(提醒我在没有程序的情况下将外部拇指驱动器连接为加密狗将无法正常工作)。
理想情况下,脚本会“监控”应用程序文件夹,这样我就可以使用通常的应用程序图标,而不是单击特殊的脚本链接(因为其他家庭成员也使用计算机)。
另外,我认为使用苹果脚本会很简单,因为它已经存在。我已经弄清楚如何显示警报:
on open "/Applications/MaxQDA.app/"
set theAlertText to "alert text."
set theAlertMessage to "subtext"
display alert theAlertText message theAlertMessage as
critical buttons {"stop", "go"} default button "go" cancel button "stop"
--> Result: {button returned:"go"}
delay 1
end open
delay 1
end open
我不确定的是 a)如何监控应用程序,或者这是否可能 b)如何让脚本决定应用程序是否正在启动:脚本能否“保持”启动过程,直到我单击警报窗口上的“开始按钮” c) 在我的系统中集成此脚本的位置。
非常感谢所有提示!
凯文
【问题讨论】:
标签: applescript