我在 iCal 的词典中看到的全部是显示、邮件、声音和打开文件警报。
注意:我知道我可以将所需的脚本保存为应用程序并创建打开文件警报,但这意味着警报会将焦点转移到应用程序上,这对我来说是不可取的。
答案1
您不必将脚本保存为应用程序,只需将其保存为 AppleScript 文件,它就会照常运行。如果您这样做,它不会窃取焦点。我已经测试过了,它有效。
set theFile to "/Users/me/Desktop/myscript.scpt"
tell application "iCal"
tell calendar "MyCalendar"
set theDate to (current date) + 1 * minutes
set theEvent to make new event at end with properties {summary:"it's a script!", description:"run the script", start date:theDate}
tell theEvent
make new open file alarm at end with properties {trigger date:theDate, filepath:theFile}
end tell
end tell
end tell