Apple脚本不适用于使用Microsoft Outlook的Mavericks

时间:2014-07-29 00:28:29

标签: macos outlook applescript

我正在尝试在Mavericks上执行一个简单的Apple脚本,但它没有执行。我面临的错误是“预期的行结束,但找到了类名”

tell application "Microsoft Outlook"
    set currentTime to (the current date)
    set newEvent to make new calendar event with properties{subject:"New Appointment", start time:(currentTime + (60 *60)/2), end time:(currentTime + (60 * 60) +(60)/2)}
    open newEvent
end tell

我尝试通过运行命令

删除重复的词典
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user

重新启动Mac,重新安装Outlook并重新安装Mavericks但仍然存在同样的问题。

有人可以向我推荐一些我完全不了解的新想法。

谢谢, 拉维。

2 个答案:

答案 0 :(得分:0)

看起来您的脚本似乎没有用行结尾正确分隔。

tell application "Microsoft Outlook"
    set currentTime to (the current date)
    set newEvent to make new calendar event with properties {subject:"New Appointment", start time:(currentTime + (60 * 60) / 2), end time:(currentTime + (60 * 60) + (60) / 2)}
    open newEvent
end tell

看起来应该是这样。

答案 1 :(得分:0)

只是格式化说明......它应该如下所示:

set currentTime to (the current date)
set startTime to currentTime + (30 * minutes) -- + 30 minutes
set endTime to currentTime + (1 * hours) + 30 -- + 1 hour 30 seconds

tell application "Microsoft Outlook"
    set newEvent to make new calendar event with properties {subject:"New Appointment", start time:startTime, end time:endTime}
    open newEvent
end tell