All I see in iCal's dictionary are display, mail, sound, and open file alarms.

Note: I know I can save the desired script as an app and create an open file alarm, but that would mean that the alarm would change focus to the app which for me is undesirable.

link|improve this question

56% accept rate
feedback

1 Answer

up vote 2 down vote accepted

You don't have to save the script as an app, simply save it as an AppleScript file and it will run all the same. It won't steal focus if you do it this way. I have tested this and it works.

set theFile to "/Users/me/Desktop/myscript.scpt"
tell application "iCal"
   tell calendar "MyCalendar"
      set theDate to (current date) + 1 * minutes
      set theEvent to make new event at end with properties {summary:"it's a script!", description:"run the script", start date:theDate}
      tell theEvent
         make new open file alarm at end with properties {trigger date:theDate, filepath:theFile}
      end tell
   end tell
end tell
link|improve this answer
I assumed that would just open the file in the AppleScript Editor. I'll try it now. – Orion751 Aug 8 '10 at 0:07
You're right! It automatically adjusted to a run script alarm. Thanks! – Orion751 Aug 8 '10 at 17:06
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.