【问题标题】:Applescript to run at shut downApplescript 在关机时运行
【发布时间】:2010-01-21 17:26:32
【问题描述】:

我正在尝试使用 AppleScript 制作一个应用程序,如果我忘记检查,它可以在关机时提醒检查我的邮件。

我从这个链接获得了帮助:http://discussions.apple.com/thread.jspa?threadID=1375949&tstart=0&messageID=7088687#7088687

在此链接中,他们建议我可以运行一个可以在登录时启动的相当应用程序,当我尝试关闭时,系统将尝试关闭它并获得所需的结果!

我试过这个脚本代码:

say "Good morning Miraaj! I will be reminding you to check your mails at shutdown. Have a rocking day!!"

退出

set the alert_message to "Have you checked your mails?"
display dialog the alert_message buttons {"Yes", "No"} default button 1
set the my_choice to the button returned of the result
if my_choice is "Yes" then
    tell application "Finder"
        shut down
    end tell
else
    tell application "Safari"
        open location "www.gmail.com"
    end tell
end if
continue quit

结束退出

但它对我不起作用!

谁能建议我哪里错了??

谢谢,

米拉杰

【问题讨论】:

  • 我认为您实际上可能会因为 SuperUser.com 的 ActionScript 而获得更多帮助。
  • Miraaj,你在 SuperUser 上问过这个吗?我检查并没有发现任何东西。我想知道类似的事情:连接/断开外接显示器时触发一个applescript。

标签: applescript shutdown


【解决方案1】:

当我将它保存为保持打开应用程序时,它现在正在工作! :)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-10-15
    • 1970-01-01
    • 2013-05-07
    • 1970-01-01
    • 2021-08-23
    • 2015-01-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多