Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

View today's iCal events on the desktop via a script Apps
Here's a small script (macosxhints mirror) that reads the data files that iCal dumps to, and prints out a small, text-only version of today's events. I use it with GeekTool, and have it display the output on my desktop.

You need to edit the script a little for your own machine. See the comments at the top -- it shouldn't be too hard. You'll also need to make it executable (chmod 755 script_name) before it can be run.

[robg adds: The customization required is identifying which calendar belongs to which filename. An easy way to do this is to open the Info.plist file in a text editor (or Property List Editor) and look for the value next to Title. Once you know that, you can copy the corestorage.ics file in the Finder, switch to Terminal, and then paste it into the right section of the script to avoid typing that long path by hand. I tested this, and it works well.]
    •    
  • Currently 2.60 / 5
  You rated: 4 / 5 (5 votes cast)
 
[30,197 views]  

View today's iCal events on the desktop via a script | 20 comments | Create New Account
Click here to return to the 'View today's iCal events on the desktop via a script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
View today's iCal events on the desktop via a script
Authored by: holo on Sep 25, '06 08:59:41AM

awesome!

is there any way to get this script to display all day events?



[ Reply to This | # ]
View today's iCal events on the desktop via a script
Authored by: redclawx on Sep 25, '06 09:08:10AM

Works fine for single events but not for repeating events.



[ Reply to This | # ]
View today's iCal events on the desktop via a script
Authored by: rwinchester on Sep 25, '06 11:21:18AM
I'd really like to see a Growl version of the script... to open up my machine in the morning and see a quick preview of what's ahead for the day would be great. Anyone?

[ Reply to This | # ]
View today's iCal events on the desktop via a script
Authored by: robleach on Sep 25, '06 12:51:10PM

The only tool I've seen out there which does this sort of thing properly is iCal::Parser (a perl module). I tried running this script on my many calendars and it gave me back 3 events for today when in fact I have 19 events scheduled for today.

I wrote a perl script like this called current_events.pl which (using iCal::Parser) grabs ALL of the events from today - including recursive events - to a specified number of days ahead and outputs text which I have a cron job set up to store in a daily updated file that my ovolab phlink app uses to speak the day's events for people who call and enter my phone system and press 2 followed by a number (1-7) for today's, tomorrow's, etc. events.

I'd post my script, but I don't have time to grab it off my home computer at the moment.

Rob



[ Reply to This | # ]
View today's iCal events on the desktop via a script
Authored by: Lutin on Sep 26, '06 05:08:13AM

Please, when you have some time, post it, I'm interested.



[ Reply to This | # ]
There's an iCal script distributed with Growl
Authored by: Diggory on Sep 25, '06 12:59:23PM
http://growl.info/documentation/ical-script.php

---
*****
monkeyfood software - http://www.monkeyfood.com

[ Reply to This | # ]

View today's iCal events on the desktop via a script
Authored by: ptroot on Sep 25, '06 01:12:19PM

modified this script to discover all the calendars in the default location.
No modification needed.

I'm still working on reading repeating events.

And allow command line parameter of a date to check for events.

Don't know how much I can put in a comment, so I won't post what
I've done.



[ Reply to This | # ]
View today's iCal events on the desktop via a script
Authored by: Lutin on Sep 26, '06 05:17:48AM

Juste use the [ code] and [ /code] tags (without the space).



[ Reply to This | # ]
View today's iCal events on the desktop via a script
Authored by: robleach on Sep 25, '06 01:35:50PM

Why bother doing the repeat event parsing? It's very complex. Just use iCal::Parser. It does a great job already. Or if you want, you can re-invent the wheel. ;)



[ Reply to This | # ]
View today's iCal events on the desktop via a script
Authored by: n1mie on Sep 27, '06 04:04:46AM

Because not everyone has it installed?!?!

---
--Chip



[ Reply to This | # ]
View today's iCal events on the desktop via a script
Authored by: dpb2009 on Sep 25, '06 05:27:08PM

this was more of a programming excersize than anything, but Ill check out iCal::Parser, thanks



[ Reply to This | # ]
View today's iCal events on the desktop via a script
Authored by: sys0p on Sep 25, '06 07:06:54PM
nearly as good as http://www.icalviewer.com/ ;)

[ Reply to This | # ]
birthdays via geektool:
Authored by: nick on Sep 26, '06 12:27:03AM
i use "birthday reminder" by Sven Janssen (http://software.stalkingwolf.net/) to display the upcoming birthdays via geektool:

/Users/YOURUSERNAME/bin/birthday | iconv -f utf-8 -t ucs-2-internal

given you place the birthday binary in ~/bin/.

[ Reply to This | # ]
View today's iCal events on the desktop via a script
Authored by: robleach on Sep 26, '06 09:36:30AM

By the time I find the time to clean it up and make it post-able, you could likely have written it yourself. It's fairly simple and somewhat ad-hoc (i.e. I don't use any sort of standard reusable format). But next chance I get, I'll clean it up and submit it.

I have another one I'm tweaking called static_events.pl which pretty much does the same sort of thing except this one outputs the events in .ics format so I can upload it to my new phone using bitpim. My phone will only accept 100 events, so I made the "number of events from today to be output" an argument to the script. I've still got some issues to fix on it though and it's been tabled for a few weeks now due to a lack of time I have to devote to it.



[ Reply to This | # ]
View today's iCal events on the desktop via a script
Authored by: robleach on Sep 26, '06 09:37:57AM

Sorry, that was in reply to Lutin. I haven't gotten used to this board interface. :(



[ Reply to This | # ]
Order of Calendars
Authored by: n1mie on Sep 27, '06 04:07:30AM

I like the script, and I've already tweaked it for my purposes. I added in all my calendars, in the order which I prefer them to appear. But for some reason they are in a completely different order in the output. Seems like it ought to step through them serial from top to bottom, but that's not what happens.

(I also removed the conversion from 24hr to 12hr clock since I prefer the former.)

Thanks for the help.

---
--Chip



[ Reply to This | # ]
Order of Calendars
Authored by: ptroot on Sep 27, '06 06:16:40AM

Hash's do not have guarenteed order.



[ Reply to This | # ]
Order of Calendars
Authored by: dpb2009 on Oct 10, '06 07:27:53PM

its because they are stored in a hash. perl doesn't store a hash in the order you entered it, but rather in an order it finds useful for retrieving it quickly. you could re-write it with an array, and then it would be in the right order.
-d



[ Reply to This | # ]
View today's iCal events on the desktop via a script
Authored by: hasseg on Jan 09, '09 07:42:17AM
Hi guys, I've made a small CLI app for printing out events or tasks from the OS X calendar database with a variety of options. It's called icalBuddy. I used Apple's Objective-C CalendarStore API instead of some 3rd-party library so it should quite reliably (and quickly) print out even events with the most complex recurrence rules.

[ Reply to This | # ]
View today's iCal events on the desktop via a script
Authored by: kupietz on Jul 13, '09 01:55:51PM

iCalBuddy only works for 10.5.x, no good for 10.4.11.



[ Reply to This | # ]