I’m trying to make a script that will get the summary of an iCal event for today, then turn it into a text file. For some reason, AppleScript won’t let me use the any of the date properties (start date, end date, etc.) because it thinks date always means the date class. This is really frustrating, especially since all my research shows scripts where people are using start date as it should be used with no problems! Does anyone know what might be going on, or have a solution?
Here’s a script I made while checking out the problem. When it tries to run I get an error every time it hits the word date
tell application "iCal"
set ThisCalendar to first calendar whose name is equal to "Work"
set MyEvent to first event of ThisCalendar
set EventProperties to MyEvent's properties
set StartDate to MyEvent's start date
end tell
StartDate
Model: MacBook
AppleScript: 2.0.1
Browser: Firefox 3.0.10
Operating System: Mac OS X (10.5)
I am not sure what the problem could be. Your script functioned fine on my machine (Intel iMac, 10.5.7). I modified it a little bit, and this works as well:
tell application "iCal"
tell calendar "Work"
set StartDate to start date of event 1
end tell
end tell
StartDate
When you examine the properties of the event in question, does it indeed have a start date?