How do I create calender alarms using Applescript (using OSX Yosemite/Mavericks)?

Discussion in 'Mac Programming' started by mrjayviper, Jan 8, 2015.

  1. mrjayviper macrumors regular

    Joined:
    Jul 17, 2012
    #1
    I have an Applescript here that triggers when an ICS file has been dropped into a folder. All it does it imports the ICS file into the Calendar and then create alarms for each calendar entry.

    This was working fine on Mountain Lion. But hasn't been working since Mavericks/Yosemite. The macmini (bought late 2014) it's installed on can only use Yosemite. I cannot install anything else.

    The calendar entries are being imported. But no alarms are being created.

    This is code I use to add the alarm. I didn't include the code that imports the ICS file but that part is working.

    Code:
    tell application "Calendar"
    	tell calendar "Home"
    		delay 1
    		set myevents to every event
    		
    		repeat with oneevent in myevents
    			tell oneevent
    				set mysummary to summary
    				display dialog mysummary
    								
    				make new display alarm at end with properties {trigger interval:-30}
    			end tell
    		end repeat					
    	end tell
    end tell
    
    As you can see from the code, I am displaying the summary for the event just as a test. I just want to find out it's opening the correct event.

    I've looked/searched for examples/documentation on the topic but hardly find anything recent (i.e. Mavericks and above).

    Any ideas on how to fix my problem? Thanks a lot
     
  2. kryten2, Jan 8, 2015
    Last edited: Jan 9, 2015

    kryten2 macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #2
    Please post the output of Events and Replies when you run the script.

    Note : Screenshots of a quick test on Mavericks and Yosemite.
     

    Attached Files:

Share This Page