Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > AppleScript date compare with iCal

AppleScript date compare with iCal
Thread Tools
Grizzled Veteran
Join Date: Mar 2003
Status: Offline
Reply With Quote
Jan 31, 2004, 12:33 PM
 
I am looking for the most efficient way to check an event in iCal to see if it falls on "today". Since there could be allot of entries to check, I want to use the most efficient code possible.
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
Jan 31, 2004, 05:12 PM
 
iCal returns standard AppleScript "date" objects when you ask for event dates and such, so you can dissect them pretty easily. Perhaps the easiest would be to compare short date string of theDateReturnedFromiCal with short date string of (current date).

The standard date object has a whole bunch of other properties, too: month, day, weekday, hour, minute, etc. Unfortunately, these aren't in an easy-to-research location like application's dictionaries are, since they're built into the AS runtime... look for AppleScript documentation on Apple's website for the full list.
Rick Roe
icons.cx | weblog
     
Grizzled Veteran
Join Date: Mar 2003
Status: Offline
Reply With Quote
Feb 5, 2004, 10:55 PM
 
Thanks, that worked great. I did go through the Apple documentation, but apparently not good enough.

Originally posted by Rickster:
iCal returns standard AppleScript "date" objects when you ask for event dates and such, so you can dissect them pretty easily. Perhaps the easiest would be to compare short date string of theDateReturnedFromiCal with short date string of (current date).

The standard date object has a whole bunch of other properties, too: month, day, weekday, hour, minute, etc. Unfortunately, these aren't in an easy-to-research location like application's dictionaries are, since they're built into the AS runtime... look for AppleScript documentation on Apple's website for the full list.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:55 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2