How to modify the attendess of an event in Calendar with Applescript?

I am trying to add/delete attendees from an event in Calendar.


In the following snippet I am trying to remove an attendee from an event if the email is user1@email.com


tell application "Calendar"
    tell calendar "Work"
        set evt to (first event where its uid = "XXXXXXX")

        set attendee_list to the email of every attendee of evt as list
        -- {"user1@email.com", "user2@gmail.com"}

        repeat with i from 1 to the number of items of attendee_list
            if item i of attendee_list = "user1@gmail.com" then
                tell evt
                    set email to "" -- ?????????
                end tell
            end if
        end repeat
    end tell
end tell


What's the correct syntax here? Any help would be appreciated!




Posted on Apr 26, 2021 11:40 AM

Reply

There are no replies.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to modify the attendess of an event in Calendar with Applescript?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.