Applescript刷新iCal中的所有日历

Applescript刷新iCal中的所有日历,applescript,icalendar,Applescript,Icalendar,我尝试用这段代码刷新iCal(Shift-Command-R)中的所有日历,但它似乎不起作用 tell application "iCal" launch reload calendars end tell Applescript命令是如何执行此操作的?可能是iCal字典中没有内置此功能。除了您已经在使用的重新加载日历命令外,我找不到任何其他命令。您唯一的选择是选择菜单项或按组合键 tell application "iCal" to activate tell applica

我尝试用这段代码刷新iCal(Shift-Command-R)中的所有日历,但它似乎不起作用

tell application "iCal"
    launch
    reload calendars
end tell

Applescript命令是如何执行此操作的?

可能是iCal字典中没有内置此功能。除了您已经在使用的
重新加载日历
命令外,我找不到任何其他命令。您唯一的选择是选择菜单项或按组合键

tell application "iCal" to activate
tell application "System Events"
    tell process "iCal"
        keystroke "r" using {command down, shift down}
    end tell
end tell

你的代码没有任何错误为什么你认为它不工作?@mcgrailm:当我运行这个脚本时,没有错误。只是什么都没发生。我必须单击Shift-Command-R来刷新iCal。我已经编辑了脚本以首先激活iCal,它似乎在我的机器上工作。