我正在尝试在 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 的限制,可能不允许基于嵌套集合(对象的categories
属性calendar event
)过滤事件?