Quick iCal/Google Calendar Sync Update

August 3rd, 2008 Ryan Toohil Posted in Apple, Google Calendar, iPhone No Comments »

So, Google announced recently that it would support CalDAV syncing with iCal, which means if you update an entry in iCal (or Google Calendar), they’ll be in sync within a few minutes. Awesome.

Unfortunately, it meant that my previous script iteration would now continually add alarms, leading to each entry having 3 or 4 alarms. Turns out that updating a local iCal calendar and adding an alarm actually updates that same info at GCal. Which is awesome (but was unexpected).

So, I made a small tweak to the script, which makes it run a bit faster and makes sure that you only get one alarm on an entry:

Try this instead:

tell application "iCal"
  set theCalendars to {"Cal1", "Cal2"}
  repeat with theCurrentValue in theCalendars
	tell calendar theCurrentValue
	  set theEvents to every event
	  repeat with theCurrentEvent in theEvents
	    tell theCurrentEvent
	      if not (exists sound alarm of theCurrentEvent) then
		   make new sound alarm at end /
		   with properties {trigger interval:-15}
		  end if
	    end tell
	  end repeat
	end tell
  end repeat
end tell

That basically means it won’t add another sound alarm if the entry already has one. Much handier. In fact, you could just take that script and have it run every few hours (either cron’d or via iCal), and not have to worry about the iTunes Sync script.

AddThis Social Bookmark Button

Syncing the iPhone with Google Calendar (now with working Alarms!)

July 22nd, 2008 Ryan Toohil Posted in Apple, Google Calendar, iPhone No Comments »

My biggest gripe with the iPhone thus far has really been a gripe with iCal. Namely, that there’s not an easy way to add alarms to subscribed calendars. I know that sounds like a silly gripe, but let me set the stage.

My main calendaring info is in Google Calendar, like a lot of folks. This is great because I can access my calendar from anywhere, on any computer, most cell phones, etc. It gives me a central way to maintain a calendar and have access to it pretty much all the time. I subscribe to my Google Calendar in iCal on my Mac, which gives me native calendaring (one-way, at least) that’s always up-to-date with the data in the Google cloud. It’s nice.

Taking it one step further, I use SyncMyCal to push my Outlook calendar to my Google Calendar as well. (I would use the normal Google Calendar Sync application, but it only syncs with the primary calendar, and I’d rather keep my personal calendar and work calendar separate.) So, every day, before I leave the office, I click a little sync button and it pushes my Outlook info up to Google Calendar. Again, one-way sync, but it’s one-way from my primary source, so I’m not worried about it.

That means I’ve got my personal and work calendars all centrally located on Google Calendar, accessible from pretty much anywhere. Including my primary machine of my Mac, where iCal subscribes to all of my various calendars. It’s a wonderful system.

Except one thing. iCal doesn’t allow you to set alarms on subscribed calendars. At least not through the interface. That makes this wonderful sync system decidedly less useful. See, between my MacBook and my iPhone, I’m pretty much covered. One is with me most of the time. If I had alarms on my calendars, then I’d pretty much have a perfect setup.

It worked incredibly well with my Motorola Q (and The Missing Sync from Mark/Space), which would import all of the calendar items from iCal, and set default alarms on them on the Q. Beautiful.

Not so much on the iPhone. For a couple of months, I’ve just dealt with the fact that using Google Calendar put me in the middle of the two supported options: using iCal and using Exchange (which became available with the 2.0 firmware). I could see the calendar events on my iPhone, but they were never going to make that nice “bleep bleep” sound and let me know that I had a meeting or I had to be somewhere in a few minutes. It’s something I had taken for granted with previous smartphones, but just chalked up to a deficiency in the early years of the iPhone.

Except I finally got fed up enough to do some digging into AppleScript and found some pointers to adding an alarm to an event. I figured why not give it a shot on subscribed calendars? Maybe I could add some alarms to my subscribed calendars?

After poking around and playing with AppleScript (something brand new to me, I got this working):

tell application "iCal"
	set theCalendars to {"Subscribed 1", "Subscribed 2"}
	repeat with theCurrentValue in theCalendars
		tell calendar theCurrentValue
			set theEvents to every event
			repeat with theCurrentEvent in theEvents
				tell theCurrentEvent
					make new sound alarm at end with properties {trigger interval:-15}
				end tell
			end repeat
		end tell
	end repeat
end tell

Basically, we grab our two subscribed calendars (those are placeholder names, replace with your own subscribed calendar names), go through each entry and add a sound alarm 15 minutes before the event. It takes maybe 10 or 15 seconds to go through both of my calendars, but lo! I end up with alarms both in iCal and on the iPhone!

Bingo. Exactly what I need. I’m sure there’s something more elegant, but this worked for me.

The next issue, of course, was a “race condition” of sorts. My calendars update themselves periodically. If they updated before I sync with my iPhone, the alarms would be gone. How could I resolve that?

How about another AppleScript? I did a bit more googling, and of course, there’s a nice way to sync your iPhone (or iPod), via AppleScript. Why not combine both scripts and drop it into the iTunes script directory? That’s a brilliant idea!

tell application "iCal"
	set theCalendars to {"Sub1", "Sub2"}
	repeat with theCurrentValue in theCalendars
		tell calendar theCurrentValue
			set theEvents to every event
			repeat with theCurrentEvent in theEvents
				tell theCurrentEvent
					make new sound alarm at end with properties {trigger interval:-15}
				end tell
			end repeat
		end tell
	end repeat
end tell

tell application "iTunes"
	repeat with s in sources
		if (kind of s is iPod) then update s
	end repeat
end tell

Now, when I’m about to leave the house, I just do this:

iTunes Sync

That’s it. All of my calendar items, from Google Calendar, sync’d to my iPhone with alarms. It’s a beautiful thing.

And I wish nothing more than for iCal to render it useless my having a “add default alarm to subscribed calendar” checkbox.

AddThis Social Bookmark Button

Evite to Google Calendar Greasemonkey Script v1.4

October 12th, 2007 Ryan Toohil Posted in Evite, Google Calendar, Greasemonkey 1 Comment »

Hey, I made a small revision to my Greasemonkey script that makes it smarter about handling time (particularly AM/PM).

It’s updated here and updated on Userscripts, where I’m up to like 566 installs! I’m a hit! Or something. And I’m like the 4th link in Google if you search for “google calendar evite!”

If you’ve got Greasemonkey, install your Evite to Google Calendar script right from here.

AddThis Social Bookmark Button

Plaxo … Not Quite the Bees Knees of Sync

July 16th, 2007 Ryan Toohil Posted in Apple, Google Calendar, Plaxo 2 Comments »

For a while now, I’ve been looking for a good way to sync the calendar on my Macbook to Google Calendar to my Outlook at work. It’d be nice to be able to know what my next day at work looks like in Outlook, then to have my Calendar sync’d down to my laptop so that I can see and adjust things while offline, then sync it all back to the master calendar in Google Calendar.

 

It shouldn’t be that tough, but so far, it has proven elusive. I’ve tried some of the free tools that are around to sync iCal with Google Calendar and Outlook with Google Calendar, but they’ve all proved a bit wonky.

 

Finally, Scoble mentioned that Plaxo had it’s new beta that would do all of the syncing through a nifty web application. So, I headed over to Plaxo.com and tried it out. It seems pretty straight-forward. You add “sync points”, which are places that Plaxo will sync your data to. I added Google Calendar, my Mac, and my work Outlook. The latter two required the installation of some software. Nothing too difficult. A couple of config tweaks later and I saw my work calendar in my Google Calendar and sync’d down to my Mac.

Perfect!

 

Except, over the following few days, I would constantly get duplicate calendars, lose the original calendar, get duplicate entries, continually have to tell Outlook which calendars I really wanted, which it would ignore and keep syncing other ones.

 

It became a royal mess.

 

So, I decided to uninstall things, get back to square one, and at least retain my Google Calendar the way it was. Except Plaxo ate my two calendars (because they no longer existed in Outlook … lesson: kill your sync points before killing your calendars). That kinda pissed me off. Thankfully, my Mac still had my calendar, so I was able to dump the ICS entries and upload them to Google (import of ICS files is a nice feature of Google Calendar, by the way!). I lost my music calendar, but it was mostly older stuff at this point, so I started that one over.

 

Plaxo just didn’t work for me, though it seems like it could be useful if they work the kinks out. It didn’t sync to Google Calendar fast enough, which was always a bit annoying. The apps for the Mac and PC were kind of clunky, but they worked ok. But borking the calendar syncing was just a bit too much to deal with at this point.

 

So, I’m back to just subscribing to my Google Calendar feeds through iCal. I’m going to try gSync for about the 4th time and hope that the final release version is finally good enough to maybe think about using full time.

 

It’d be cool if Google solved this problem themselves (maybe opening up the GCal API), but I’m not holding my breath.

AddThis Social Bookmark Button

Evite to Google Calendar Greasemonkey Script v1.3

June 25th, 2007 Ryan Toohil Posted in Google Calendar, Greasemonkey, Javascript 2 Comments »

I’d noticed a couple of problems with my Evite to Google Calendar script, so when I got an Evite today, I took some time to figure out how to fix it. I fixed everything I could find, and made the script a bit more robust at handling future Evite changes. So, if you’ve been having problems, give it another shot and hopefully it’ll work for you now.

Install Evite to Google Calendar Greasemonkey Script v1.3

You can also install it from UserScripts, like 387 other people.

AddThis Social Bookmark Button

Evite to Google Calendar Greasemonkey Script v1.2

April 21st, 2007 Ryan Toohil Posted in Evite, Google Calendar, Greasemonkey 2 Comments »

I got my first Evite in a while, and I noticed that my little Greasemonkey script wasn’t working for it. That lead me to go back and check out the entry at Userscripts and find out that people were getting bit by the fact I had to hard code the timezone info, which isn’t very friendly.

So, I opened it up again and hacked around and fixed both bugs. Took me about 30 minutes, and got my mind off of recent events.

Evite2GoogleCal at Userscripts

Now with:

  • the ability to use it for invites that happened on the 1-9th of the month (yeah, that was a dumb bug)!
  • automagically detecting your timezone and setting the entry to the right time!

Be the 191st person to install it!

AddThis Social Bookmark Button

My Small Impact on the World

March 12th, 2007 Ryan Toohil Posted in Evite, Google Calendar, Greasemonkey No Comments »

I went to check out my Evite To Google Calendar script page at Userscripts, since I like to poke in every once in a while and see if anyone is actually using my script.  Last I had checked I had about 4 downloads.

Today: 64! 64 people have installed it. That’s pretty cool. Granted, that’s not a ton, but it’s a lot more than before! I left a comment, since I’m hoping someone will follow up and let me know if anyone really finds it useful.

AddThis Social Bookmark Button

The much awaited … stuff

February 19th, 2007 Ryan Toohil Posted in Apple, General, Gmail, Google, Google Calendar, Google Reader, Web hosting, smells like fish 3 Comments »

It’s been a busy few weeks. The biggest news is probably my latest purchase: I got my first non-PC in the form of a MacBook Pro. I’d been looking at getting a laptop for a while, mostly because my existing laptop is old, underpowered, has a half-working keyboard, and had been resigned to sitting on my stereo so that I could stream music to it. I couldn’t even bring it anywhere, as the battery life was simply miserable.

Working at a web hosting company, spending a majority of my day ssh’d into a Unix box, I’d gotten very comfortable at the command-line again, much like I was back in my college days. Between the command line and the browser, I didn’t really use any major Windows applications at the office or at home. I use MS Office, occasionally, but I don’t even use that at home (where I use OpenOffice). My PC is still a great box, but it was a glorified game machine.

Taking it one step further, I’d realized how much of my life really is in the browser these days. My mail goes to Gmail; my calendar is Google Calendar; my RSS feed reader is Google Reader. A few years ago I ranted that I couldn’t see ever moving completely to a thin client/browser world. Granted, it was in the middle of a major Comcast outage, where they weren’t sending any traffic to Yahoo!, which is pretty significant. These days, while there are minor outages, it’s rare that I can’t get to my data online. When I can’t, I can get it via my cell phone (and once Google gets Calendar working on a phone, I’ll be pretty much set). Finally, with Google (and Microsoft and Yahoo!) exposing your data in interesting ways (RSS, iCal feeds, private HTML), you can always pull it down into your thick client and access it offline, should you need to.

I’ve also had a desire to get creative again, whether its restarting the podcast (which will happen), blogging more, working on my website, or just generally brainstorming other ideas, I’ve needed a way to get untethered from my PC. It’s cold in my little office during the winter, and I can’t neatly multitask in front of the TV. With most of the creative ideas requiring the authoring of at least a little bit of code, I was looking for a laptop that would let me use my friendly Vim application to hack some HTML, CSS, or Perl.

All that put together lead to me looking at a Mac. Not because they’re trendy, but because it’s the nicest Unix machine you’ll see. OS X is a very pretty, and functional, interface on top of a Unix backend. I can take my laptop to work and scp files from a terminal window to our data center at rates that greatly exdeed anything I can get over FTP. I can pop open a terminal window and quickly turn on apache and mess with some Perl code before I upload it to my website. I can open up GarageBand and pull together a podcast a little more easily than I can in Audacity on the PC. The ability to neatly run Windows in either VMWare or Parallels while inside of OS X is what pushed me over the top. (Actually, it was one of my co-workers showing me IE running in coherence mode inside Paralells, which meant he could have IE next to Firefox next to Safari on his desktop, allowing him to test 3 major browsers at the same time. Very cool.)

So, I pulled the trigger and picked up a MacBook Pro. It took me a little while to get used to the differences between the Mac and Windows, but the learning curve to being productive is really shallow. I’ve nearly replicated all of the functionality of my Windows PC, but with the ability to do it from anywhere in my house. I can listen to music streaming from my iTunes library while I type this up, waiting for Heroes to buffer up enough on the DVR so that I can watch it without commercials. Soon, I’ll probably throw together another episode of my podcast, which I can do significantly more easily now that I don’t have to start up a bunch of different applications (I’m still figuring out how to make the built-in mic work, as it seems to record to quietly).

So, I hope that my new found freedom will allow me to be a bit more prolific. With work and general life stuff, I’ve had to cut back my posting at The House That Dewey Built — I’ve sort of just become the tech guy and will let Jeff and the new folks concentrate on posting (though, I might have to throw something up there when the feeling hits me). I’ve got plans to at least throw something up at ryantoohil.com and let it be my testing ground for learning more CSS and JavaScript. I’m feeling a bit more invigorated, which is nice.

I actually want to build my home page around my little Mii off of my Wii. I haven’t gotten a good screenshot yet, but here’s an approximation. And yes, I’m a huge dork.

Mii

Hopefully, this desire to be creative will last. I’m going to try to get something up most days this week. I’m thinking that I’ll finally revisit the “So you want to have a web site” series. I’m planning on getting up a Dear Leader-centric podcast.

If you’re still out there reading, feel free to leave a comment. I’m curious to see how many are actually reading this. Checking my logs, I’ve got at least two readers in Google Reader (1 is me …) and 2 in NewsGator. If I was smart, I’d move to FeedBurner so I could track it, but I’ve got no desire to do that just yet.

That’s all for today. Heroes is starting, and I’m hoping that they’ll recover from their recent doldrums and put together a fun episode that doesn’t smell like fish.

AddThis Social Bookmark Button

More Google Calendar and Evite Fun

January 26th, 2007 Ryan Toohil Posted in Evite, Google Calendar, Greasemonkey 1 Comment »

After now having at least 2(!) people besides myself using the little Greasemonkey script I wrote to allow quick adding of Evite invites into Google Calendar, I’ve finally added my script to userscripts. Maybe I’ll eventually have 10 people using it. Then I’ll be famous. And maybe rich.

AddThis Social Bookmark Button

Evite to Google Calendar Greasemonkey Script v1.1

January 10th, 2007 Ryan Toohil Posted in Evite, Google Calendar, Greasemonkey, Javascript 10 Comments »

I got a nice trackback from the arc of time blog on my earlier post about creating a crappy little Greasemonkey script to let me quickly add Evite events into my Google Calendar. What that reminded me of was the fact that the script didn’t work for events that didn’t have an end time (and also got messed up with the time change).

Well, I fixed it. And now you can download the new version of the script that will let you, at least as far as far as I’ve tested, add any Evite directly into your Google Calendar. If there’s an end time, it’ll be set. If there’s not, your start and end time will be the same, but you can quickly tweak that.

It all seems to work.

To use it, I’m assuming you have Greasemonkey. If not, go get it.

Then, install this user script: Evite to Google Calendar

That’s it. Go to any open Evite. You’ll see a column on the left that looks like the image below.
Evite2GCal
Note the link circled in red. That’s what the script adds. Click that. You’ll be whisked away to Google Calendar where you can quickly add the event and be done with Evite.

Again, I think it works. It at least works on what I’ve tested it on. Give it a shot. Let me know. If you like it, link to my blog so I can be the coolest.

AddThis Social Bookmark Button