5 Replies Latest reply: Mar 2, 2013 11:17 AM by John Maisey
Uproooar Level 1 Level 1

I have schedule of nba games. There's no alerts in it.

So i want to add "Message with sound 1 day before" to all events in this calendar.


MacBook Pro, OS X Mountain Lion (10.8.2)
Solved by John Maisey on Feb 20, 2013 2:41 PM Solved

You could use Applescript to do this. The following script adds a message with sound alarm 24 hours before each event.

 

Best wishes

John M

 

 

-- John Maisey -- www.nhoj.co.uk -- 20 Feb 2013
tell application "Calendar"
  launch
     repeat with myEvent in events of calendar "Celtics Schedule 2012-2013"
        make new sound alarm at end of sound alarms of myEvent with properties {trigger interval:-1440}
     end repeat
end tell

  • John Maisey Level 5 Level 5

    You could use Applescript to do this. The following script adds a message with sound alarm 24 hours before each event.

     

    Best wishes

    John M

     

     

    -- John Maisey -- www.nhoj.co.uk -- 20 Feb 2013
    tell application "Calendar"
      launch
         repeat with myEvent in events of calendar "Celtics Schedule 2012-2013"
            make new sound alarm at end of sound alarms of myEvent with properties {trigger interval:-1440}
         end repeat
    end tell
    
    
  • Uproooar Level 1 Level 1

    Big thanks John! Works great.

  • John Maisey Level 5 Level 5

    I'm glad it helped.

  • Uproooar Level 1 Level 1

    I decided to add "allday event" option to all of these events but it's dufficult for becasue I'm new to scripting.

    Could you help me with this?
    Thanks in advance.

  • John Maisey Level 5 Level 5

    Hi,

     

    This is the above script with the alarm settingh being removed and making the events all day. I'm not sure if this wiil stick for a subscribed calendar and don't have time to check now.

     

    -- John Maisey -- www.nhoj.co.uk -- 2 March 2013
    tell application "Calendar"
      launch
              repeat with myEvent in events of calendar "Celtics Schedule 2012-2013"
                        set allday event of myEvent to true
              end repeat
    end tell
    

     

    John M