• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
iCal Event Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

iCal Event Problem


  • Subject: iCal Event Problem
  • From: Anthony Sharman <email@hidden>
  • Date: Wed, 12 Nov 2008 20:49:33 +0100

Hello Everyone,

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. 

The start date read is "14/11/2008" which is then set to date "Friday, November 14, 2008 00:00:00" by AppleScript. However, iCal sets the start date to the 13th. Here's the processing part of my script:

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
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Help Book
  • Next by Date: RE: accessing a property of an object in AppleScript
  • Previous by thread: Re: Are You Sure ?
  • Next by thread: Re: iCal Event Problem
  • Index(es):
    • Date
    • Thread