I writing a script which reads a CSV file then creates an iCal events. The problem is that iCal creates the events a day earlier than the passed date.
set theData to (read file (theDroppedFile as Unicode text))
set AppleScript's text item delimiters to CR
set workingData to text items of theData
set AppleScript's text item delimiters to tab
set i to 1 -- skip headers
repeat until i = (count of workingData)
set i to i + 1
set workStrg to (item i of workingData)
if first text item of workStrg is "" then exit repeat
set myStartDate to date (text item 2 of workStrg)
set myEndDate to date (text item 4 of workStrg)
tell application "iCal"
tell calendar "Test"
make new event at end of events with properties {start date:myStartDate, end date:myEndDate, summary:(text item 1 of workStrg), location:(text item 9 of workStrg), allday event:true}
end tell
end tell
end repeat
set AppleScript's text item delimiters to ASTID
Does any one have any idea how to correct this?
Thanks in advance for any help.
Cheers,
Tony
T