Date from LiveCode to Applescript

zryip theSlug zryip.theslug at
Thu Nov 25 18:42:19 EST 2010

In case it could be of some interest for someone else in the list, a
full example for adding a new event in iCal with applescript:

on mouseUp
   put "11/25/2010 09:00" into tFinalDate -- Your date time in your own\
    format here (MM/DD/YYYY HH:MM or DD/MM/YYYY HH:MM)
   put "MyCalendar" into theCal
   put "MyEvent" into theEvent

   put "tell application "&quote&"iCal"&quote&cr& \
         "tell calendar "&quote&theCal&quote&cr& \
         "set theDueDate to (date("&quote&tFinalDate&quote&")) + 2 * days"&cr& \
         "make new event at end with properties {start
         "end tell"&cr&\
         "end tell" into tScriptToDo
   do tScriptToDo as applescript
   answer the result -- the result should contain the id of the new
calendar event
end mouseUp

Be sure to have the "MyCalendar" calendar created in iCal.
The calendar event named "MyEvent" will be created in date of
"11/25/2010" + 2 days = "11/27/2010" at 9:00

-Zryip TheSlug- wish you the best! 8)

More information about the use-livecode mailing list