10 Replies Latest reply: Nov 7, 2014 6:20 PM by Andrew Bucknill
vburger Level 1 Level 1 (0 points)

Over the years I have added repeating Events with Alerts to iCal on various devices (some of them passed on to my relatives). As a  result I get plenty of Alert emails or sounds. I find it onerous to go through all repeating events to delete the alert. Hence my question: how to delete all Alerts at once?

Thanks for any suggestions/pointers/ideas. Cheers, Veit


iMac, OS X Mountain Lion (10.8.1), iPhone 4S with iOS6
  • vburger Level 1 Level 1 (0 points)

    Any ideas out there???

  • Dale Sorel Level 1 Level 1 (0 points)

    Yes, that's exactly what I'd like to know. You'd think there had to be some way to delete all of your alerts out of Calendar.

  • John Maisey Level 5 Level 5 (6,895 points)

    Hi,

     

    You can turn off all alerts for a calendar by selecting it from the calednar list on the left in Calendar, pressing Cmd-i and putting a check by the "Ignore alerts" option.

     

    Alternatively an Applescript to permanently remove all alerts would be not too complex.

     

    Best wishes

    John M

  • Dale Sorel Level 1 Level 1 (0 points)

    Alternatively an Applescript to permanently remove all alerts would be not too complex.

     

    Hi John,

     

    I wonder if you could elaborate on the AppleScript idea. It's been a while since I've done anything in AppleScript, but it sounds like it might do exactly what I'm looking for.

  • John Maisey Level 5 Level 5 (6,895 points)

    Hi Dale,

     

    Something like below.  If you have default alarms set in preferences in iCal (or Calendar.app) then these will be re-added and you should turn them off in the applications preferences if you do not need them. The script will also not affect subscribed calendars or events you can not edit manually.

     

    The effect is permanent and I would strongly suggest you backup your calendars before running the script below.

     

    John M

     

     

    -- John Maisey -- www.nhoj.co.uk -- 30 Nov 2013 --
    -- Removing all alarms from your editable calendars --
    -- This process may take some time to run and is permanent. --
    tell application "iCal"
      activate
      delay 0.5
       display alert "Removing all alarms from your editable calendars" message "This process may take some time and is permanent. Are you sure you want to do this?" buttons {"Yes", "No"} cancel button 2
          repeat with myCalendar in (calendars whose writable is true)
             repeat with myEvent in events of myCalendar
               delete display alarms of myEvent
               delete mail alarms of myEvent
               delete sound alarms of myEvent
               delete open file alarms of myEvent
              end repeat
           end repeat
      display alert "Removing all alarms from your editable calendars" message "This process is complete." buttons {"OK"} default button 1
    end tell
    
    
  • Dale Sorel Level 1 Level 1 (0 points)

    Thanks John!

  • John Maisey Level 5 Level 5 (6,895 points)

    I hope it helps.

  • Andrew Bucknill Level 1 Level 1 (0 points)

    Hi John,

     

    Thanks so much for your help with this problem. I am trying to remove alerts for a couple of specific shared calendars (which I can edit) but am having some difficulty due to my inexperience with applescript! I am also not sure where else to go for help solving this problem.

     

    My plan is to run your script a couple of times specifying one calendar at a time by name.

     

    This is the modification I made to your script:

     

    tell application "Calendar"

      activate

              delay 0.5

              display alert "Removing all alarms from your editable calendars" message "This process may take some time and is permanent. Are you sure you want to do this?" buttons {"Yes", "No"} cancel button 2

              set calname to "Consultant_on_call"

      --- repeat with myCalendar in (calendars whose writable is true)

              repeat with myCalendar in (calendars whose name is calname)

                        repeat with myEvent in events of myCalendar

      delete display alarms of myEvent

      delete mail alarms of myEvent

      delete sound alarms of myEvent

      delete open file alarms of myEvent

                        end repeat

              end repeat

              display alert "Removing all alarms from your editable calendars" message "This process is complete." buttons {"OK"} default button 1

    end tell

     

    Are you able to tell me what I am doing wrong? Thanks again.

     

    Andrew

  • Andrew Bucknill Level 1 Level 1 (0 points)

    An update on this issue - apparently applescript silently fails to delete an alert if it is the 'default' alert.

     

    I'm still trying to figure out if there is a work around.

  • Andrew Bucknill Level 1 Level 1 (0 points)

    Another way to do this may be to export the calendar from ical to a .ics file. (Make a duplicate of the .ics as a backup before proceeding to the next step). Open the .ics file in text edit and do a find and replace to change the settings of the events.

     

    You can then delete the original calendar from ical and re-import the modified .ics file.