iCal Alarm Question

I have created an Applescript that takes a formatted tab-delimited text file and creates events in iCal – helpful for inputting a number of events faster than the interface of iCal allows.

I have even gotten it to set an alarm. However, I am not getting the TYPE of alarm set that I wish to have.

I would like, for an all-day event, to have an alarm go off about six hours prior to the start of that day (i.e., 6 pm the day before the event), with a message about the event.

This is the code I am using:

tell this_event
	make new mail alarm at end of mail alarms with properties {trigger interval:-6:00}
end tell

The alarm it creates, however, is one that sends an e-mail to me, 5 minutes before the event.

What should I do to make this set an alarm that does a message with a sound, 6 hours before the day in which the all-day event occurs?

Maybe this will work.

make new mail alarm at end of mail alarms with properties {trigger interval:-(6 * 60)} -- number of hours * 60 minutes

– Rob

I found that I had copied code wrongly from my source. To get a SOUND alarm, it should read like this:

tell this_event
	make new sound alarm at end of sound alarms with properties {trigger interval:trigger, sound name:"2-beeps"}
end tell

The problem is, no matter how I try to load the variable “trigger” from the text file I am getting this stuff from, it still does a (default?) time of 5 minutes.

Back up in the Applescript, it gets this value from a text file with this command:

set trigger to item 6 of item i of theBigList as string

Does it need to load this as something other than a string?

Found the answer. I set trigger as INTEGER, and it works. Thanks putting me in the right direction!