How to filter Outlook for Mac calendar events by category using AppleScript

Hi all --
I'm trying to write an Applescript on OSX to filter Outlook for Mac 2011 calendar events based on event categories, e.g. find all events tagged as "Conference". For example, I have a calendar event named "WWDC" that is found by the following script:
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
The above finds 1 event, and the final line displays "true" as this event has been tagged with the Conference category.
However what I really want to do is find all such events. The following fails to match any events:
set theConferenceList to every calendar event whose categories contains {theCategoryConference}
ThIs seems to me like it should work, but returns 0 matching events. Is there a different syntax to use, or is this a limitation of Outlook for Mac that perhaps doesn't allow filtering events based on a nested collection (the categories attribute on calendar event objects)?
Thanks!
Ramon

Hello
I don't have Outlook 2011 but only guess here.
Generally speaking, AppleScript's "whose" filter is very limited and does not support list containment test. So perhaps you'd have to resort to something like the following script, which actually scans the events for test.
tell application "Microsoft Outlook"
    my events_with_categories({category "Conference"})
end tell
on events_with_categories(cats)
        list cats : list of categories to be matched
        return list : list of calendar events whose categories contain every item of cats
    script o
        property ee : {}
        property cc : {}
        tell application "Microsoft Outlook"
            set ee to calendar events
            repeat with e in my ee
                set e to e's contents
                set cc to e's categories
                set _match to true
                repeat with c in cats
                    set c to c's contents
                    if c is not in my cc then
                        set _match to false
                        exit repeat
                    end if
                end repeat
                if _match then set end of my ee to e
            end repeat
            return my ee's contents
        end tell
    end script
    tell o to run
end events_with_categories
Notes.
* Script is not tested.
* IF this works but is too slow, we may try to speed it up by retrieving categories of events (list of lists) in one statement, by which we can dramatically reduce the total number of Apple Events to send.
Good luck,
H

Similar Messages

  • Why did Apple remove the INFO tab in iTunes? I like syncing my Outlook for Mac Calendar to my iPhone.

    I find the iCal very restricting and like using my Outlook for Mac calendar and contacts.  But with the new Maverick, they have removed this feature.  Why can't they play nice w/Microsoft?

    This has nothing to do with Microsoft. It was removed with Mavericks for syncing direct with Apple's Address Book and iCal, etc. via the iTunes sync process as well.

  • Can I print Outlook for Mac calendar in landscape format?

    I want to print an Outlook for Mac calendar (a single month) in landscape fomat, but there doesn't seem to be a way to do that?  What am I missing?

    file>page setup>orientation>and click on the icon on the right side.  I have outlook '11.
    <-------- This one

  • How can I get Outlook for Mac Calendar synced to Google Calendar?

    The Mac calendar produces a view of the Outlook calendar and good syncing. But I cannot find a way of syncing this view with Google calendar. I can get a separate view in Mac Callendar of mt Google calendar adn again good syncing. But I cannot get the Outlook view on Mac calendar across to the google view. What am I missing here?

    Dear Klaus, Many thanks for your response. However as far as I can see the Outlook in this thread is always on a Windows PC. My Outlook is on the Mac.
    I can sync to Mac Calendar V6 with Outlook 2011 for Mac and with Google calendar. But the Google sync and the Outlook sync are in diferent accounts although both visible on the Mac Calendar at the same time. However I cannot find a way of using the Mac Calendar to bidge across from the "On my Mac" account (which is synced with the Outlook for Mac) to the Google account.
    Kind regards, P.

  • How to view Outlook for Mac .olm file?

    I am getting rid of MacBook Pro (OS X 10.9.3) where I used Outlook for Mac.
    I exported mail, contacts, calendar, tasks, and notes into an .olm file.
    How can I view this .olm file on my new Mac Air (OS X 10.9.3) where I have no Widows applications?
    I am not keen on importing this .olm data into for instance Apple Mail. I just want to be able to view/search the file for contacts or emails.

    Hello
    I don't have Outlook 2011 but only guess here.
    Generally speaking, AppleScript's "whose" filter is very limited and does not support list containment test. So perhaps you'd have to resort to something like the following script, which actually scans the events for test.
    tell application "Microsoft Outlook"
        my events_with_categories({category "Conference"})
    end tell
    on events_with_categories(cats)
            list cats : list of categories to be matched
            return list : list of calendar events whose categories contain every item of cats
        script o
            property ee : {}
            property cc : {}
            tell application "Microsoft Outlook"
                set ee to calendar events
                repeat with e in my ee
                    set e to e's contents
                    set cc to e's categories
                    set _match to true
                    repeat with c in cats
                        set c to c's contents
                        if c is not in my cc then
                            set _match to false
                            exit repeat
                        end if
                    end repeat
                    if _match then set end of my ee to e
                end repeat
                return my ee's contents
            end tell
        end script
        tell o to run
    end events_with_categories
    Notes.
    * Script is not tested.
    * IF this works but is too slow, we may try to speed it up by retrieving categories of events (list of lists) in one statement, by which we can dramatically reduce the total number of Apple Events to send.
    Good luck,
    H

  • Can't sync Outlook for Mac Calendar with iCloud

    I've just updated my Macbook Pro to OS X and now I can't get my Outlook for Mac 2013 (14.3.9) Calendar to sync with my iPhone 5.  It seems iTunes no longer allows for syncing calendars and it all has to happen via iCloud.  Is this correct?  How do I get them to sync, then?  I've looked in other discussions (from a while ago) and none of those fixes are working.  Thanks in advance!

    Thank you, randers4.  Not the solution I wanted but I am glad to get an answer.  I'd thought that since the support articles I'd seen came out before the latest update (you're right, I do have 2011) that maybe there was a work-around.  Of course all of this has been discovered after I entered my three kids' baseball/softball practice and game schedules into Outlook.  Any quick and dirty way to transfer it all over? 
    Thanks so much for taking the time to answer me.  Copious amounts of time has been wasted on this issue and I'l be glad to move forward. 
    Warmly,
    Sara

  • How to sync Outlook for Mac 2011 calender with iCal

    I am currently running IOS 10.6.8.
    I use Outlook for Mac 2011 and I have been having problems syncing my appointments with iCal.
    I have outlook set up correctly in the preferences to sync all calendars but this does not appear to happen.

    Here's some screen grabs of the settings I use. I do not use the online iCal calendar. My iphone is synced to outlook and the local ical calendar hosted on my laptop.
    I can enter and receive/accept appointments using any of these three calendars and they all update and sync.
    The calendar called "No category" is my outlook calendar.
    If I enter any appointments they have to be entered on the calendar called "work" on my laptop and phone – otherwise outlook does not pick them up.
    As demichae said in his post above "Outlook doesn't see the stuff in iCal" – at least the online iCal stuff.
    It's not very straightforward.
    Hope this helps.

  • Outlook for Mac - Calendars Suddenly Hiding

    Hello everyone,
    I've been scouring the net trying to find someone else having this issue and have not had any luck. Hoping maybe one of you might have some insight.
    We are running Exchange 2010. I have a Mac user who is running OS X 10.4.4 and (as of my posting this) he is running the most up to date version of Microsoft Office 2011 for Mac.
    The issue he is having is that randomly, shared calendars that he has selected will become deselected and not show in his calendar. The shared calendar is still connected, the check box to enable viewing it has just be deselected. Once he checks the box again, the calendar will once again show up. 5 mins later, it (or another shared calendar) will deselect itself again.
    I'm not really sure where to start with this one. Anyone have any suggestions?
    Thanks!
    This topic first appeared in the Spiceworks Community

    No, the only online solution supported with Office for Mac is Microsoft Exchange.

  • BB BOLD 9700 sync issues with Outlook for MAC

    Hi Support, 
    I hope that you can help me?  I have been having issues with my BB calendar not being able to sync with my Outlook for MAC calendar.  I am using BB OS 6.0, Blackberry Desktop software 2.2.0 and Mac OS X version 10.7.2.
    I have been able toget around the calendars not syncing but this morning I added iCal to iCloud, stupid move as it erased my entire calendar.
    i was wondering if someone could help me restore my Outlook calendar and have my BB and calendar sync properly.
    Please Help!!!

    Hello and welcome to the BlackBerry Support Community Forums.
    The BlackBerry Desktop Software needs a local calendar for sync. It does not support the iCloud.
    You will need to create a new local calendar in your iCal to continue synchronizing with the Desktop Software.
    As for restoring your Outlook calendar, you will need to talk to Apple for assistance.
    -HMthePirate
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • I run Outlook for Mac on my Macbook Air (with Yosemite). I need to sync my Outlook calendar with my iPhone and iPad - is there a way or app available ?

    Syncing Outlook for Mac calendar with iPhone & iPad

    Veranda Magazine is a free app available for iOS devices in the iOS App Store.  You then purchase a Veranda Magazine subscription from within the app.  In other words, the app itself is free, but the contents are not.
    There is no way to duplicate or import this to a Mac.  Your Mac runs a totally different operating system.
    iBooks can now import to Mac since OS X Mavericks came out about a month ago.  But that does not apply to magazines or iOS Newsstand publications.

  • MS Outlook for Mac 2011 great for eMail

    I recently decided to give MS Outlook for Mac 2011 a try after using the native mail.app with my MacBook Pro (13 inch, Mid 2012), and wow! I don't know if it's because I have always used Outlook on my PC and have grown accostomed to it, but it really does feel like the interface, rules, folders, everythign is better!
    I have 3 imap accounts that I run through Outlook (same ones in mail.app) and I now no longer feel like I'm "losing" eMail. For the past 6+ months I have lost eMail messages due to the way mail.app organizes them. It was a real hassle having to do exhaustive, complex searches involving subject, sender, date. No longer.
    Anyway, just thought to write this up in case anyone else is considering jumping from mail.app to Outlook. Oh, and I ONLY use outlook for eMail. For Contacts and Calendar items, I continue to use the native apps (although I did import my contacts list in order to automatically download pictures in eMails).

    vCards exported from Outlook are not compatible with iCloud if that's what you're trying to import it to.  You'll have to do something like create a Gmail account, then export your Outlook contacts to Gmail (see http://office.microsoft.com/en-us/outlook-help/export-outlook-contacts-to-google -gmail-HA001148902.aspx), then export the contacts from Gmail as a vCard (see https://support.google.com/mail/answer/24911?hl=en) and import it to iCloud (see http://support.apple.com/kb/PH3605).

  • Uninstallation of Outlook for Mac

    Could anybody please advise on how to uninstall Outlook for Mac and Lync from a MacBook? I have followed instructions listed in http://support.microsoft.com/kb/2398768, however, Lync and Outlook for Mac are still present.
    Thanks in advance.

    Thanks for responding to help me with my issue. I am talking about the following packages.
    1) Outlook for Mac
    Install Outlook for Mac
    2) Lync
    http://www.microsoft.com/mac/enterprise/lync
    I am at a loss and this is the last resort I am seeking before formatting my system.
    Please assist.

  • How do I populate my "onmicrosoft" calendar with my events from "on mycomputer" in outlook for mac 2011

    I have seen Robert Twellman's answer about a microsoft exchange account workaround for sync outlook for mac with iphone but . . . . I cannot figure out how to get my "on mycomputer" calendar events (about 1800) onto the "onmicrosoft" calendar.  I tried import but that just creates an archive on my computer.  Help please.

    Hi Francorosso,
    Welcome to the Apple Support Communities!
    I understand that you have downloaded the iCloud Control Panel on your Windows computer and would like to sync your contacts and calendars between your iPhone and computer. There are two different resources I would recommend reading over and working through in this situation. 
    The first article I wold recommend using as a resource is the one linked below. This article will help you isolate and troubleshoot the syncing disconnect between your iPhone and Outlook calendars. 
    Troubleshooting Sync Services on Windows with Microsoft Outlook 2003, Outlook 2007, or Outlook 2010 - Apple Support
    To further troubleshoot calendar syncing issues, please review the Troubleshooting on Microsoft Windows (Microsoft Outlook) section of the next attached article. 
    iCloud: Troubleshooting iCloud Calendar - Apple Support
    Best regards,
    Joe

  • I'm too old to learn iCal.  How do I tell iTunes to synch with Outlook for Mac for all of the Contacts and the Calendar on my iPhone and iPad??  Thanks

    I'm too old to learn iCal.  How do I tell iTunes to synch with Outlook for Mac for all of the Contacts and the Calendar on my iPhone and iPad?? 
    Also, once I figure out how to replace iCal with Outlook/Mac on iTunes, how do I synch the phone and pad so that the information on those devices over-writes onto Outlook as a backup, rather than having a blank Calendar on Outlook wipe out all of the information on the phone and pad???
    Thanks

    If you haven't tried already, plug your devices into iTunes, and on each device next to the "Summary" tab at the top is another tab called "Info." Click that and scroll down to Contacts, Calendars, etc. There should be a pull down bar under each category for "Sync contacts from..." and you should be able to select from that pull down list Outlook.  Hit Apply at the bottom and see if that does it.

  • Imac is 4 months old.  Using installed Outlook for Mac 2011 but now want to use ical so that I can start to use iCloud to sync with my Ipad2 and iPhone.  How do I move my calendar from outlook to ical on the iMac?

    This is my first attempt at using this forum so please be patient with me.  I am new to the apple world.  Bought an Imac desktop computer back in October and installed Microsoft Office for Mac 2011 because I was used to Word, Excel, Powerpoint, and outlook.  Now I am being told that I should be using ical for my calendar so that I will be better able to move to icloud for use between my Imac, Ipad2, and Iphone.
    The question is:  how do I move my calendar which is in "Outlook for Mac 2011" into ical on my Mac?  Do I have to remove the Outlook entries from the computer and reinstall them back to the same machine or can I somehow move calendar entries within the machine?  I appreciate any help I can get.  Thanks.

    I also already deleted my phone number from iMessage on my MBP.

Maybe you are looking for