I know that I can define a new iCal event programmatically, by means of AppleScript, defining something like:
tell application "iCal"
tell calendar "My Calendar"
set theCurrentDate to current date
set newEvent to make new event at end with properties {description:"Test Event Description", summary:"Test Event", location:"Foo Location", start date:date "21/5/2012", end date:date "23/5/2012", allday event:true}
tell newEvent
make new sound alarm at end with properties {trigger date: date "21/5/2012 09:00", sound name:"Glass"}
end tell
end tell
end tell
However, I'm not really happy with having to say a precise date in 'trigger date', I'd prefer to be able to specify 'the same day at 9:00' or '2 hours before'. This is is possible via the GUI, but I cannot find the corresponding AppleScript syntax. Is there a reference for this sort of things?
Thank you in advance.