【发布时间】:2013-06-27 14:11:55
【问题描述】:
我正在尝试在 OSX 上编写 Applescript,以根据事件类别过滤 Outlook for Mac 2011 日历事件,例如找到所有标记为“会议”的事件。例如,我有一个名为“WWDC”的日历事件,可以通过以下脚本找到:
tell application "Microsoft Outlook"
set theCategoryConference to first category whose name is "Conference"
set theConferenceList to every calendar event whose (subject is "WWDC")
display dialog "There were " & (count of theConferenceList) & " Conferences."
set theEvent to item 1 of items of theConferenceList
display dialog "Categories contains conference: " & (categories of theEvent contains {theCategoryConference})
end tell
上面找到 1 个事件,最后一行显示“true”,因为该事件已被标记为会议类别。
但我真正想做的是找到所有此类事件。以下未能匹配任何事件:
set theConferenceList to every calendar event whose categories contains {theCategoryConference}
是否可以使用不同的语法,或者这是 Outlook for Mac 的限制,它可能不允许基于嵌套集合(calendar event 对象上的categories 属性)过滤事件?
【问题讨论】:
标签: macos calendar outlook applescript