Skip to Content »

iRoss.net » MobileMe “Push” from Mac

 MobileMe “Push” from Mac

  • July 13th, 2008
  • 11:49 pm

MobileMe is an excellent service, but has been criticised by a few for not implementing true ‘push’ functionality when you make changes on your mac … e.g. if you add a new appointment in iCal, it could take up to 15 mins to update your MobileMe account (and therefore your iPhone)

The following is a (not particularly ideal, just a quick hack) bash script that provides a quick workaround and allows my phone to stay up to date almost instantly :)

#!/bin/bash

OLD=`ls -laR ~/Library/Calendars/ | md5`;

while [ 1 == 1 ]; do
	COMPARE=`ls -laR ~/Library/Calendars/ | md5`;
	if [ $OLD != $COMPARE ]; then
		/System/Library/PrivateFrameworks/DotMacSyncManager.framework/Resources/dotmacsyncclient --sync com.apple.DotMacSync --entitynames com.apple.calendars.Attendee,com.apple.calendars.AudioAlarm,com.apple.calendars.CalDAVAccount,com.apple.calendars.Calendar,com.apple.calendars.CalendarOrder,com.apple.calendars.DisplayAlarm,com.apple.calendars.Event,com.apple.calendars.MailAlarm,com.apple.calendars.Organizer,com.apple.calendars.Recurrence,com.apple.calendars.Task,com.apple.contacts.CalendarURI,com.apple.ical.calendars.DotMacPublisher,com.apple.ical.calendars.Invitation,com.apple.ical.calendars.Node,com.apple.ical.calendars.ProcAlarm,com.apple.ical.calendars.RootNode,com.apple.ical.calendars.TaskOrder,com.apple.ical.calendars.URLPublisher;
	OLD=$COMPARE;
	fi;
	sleep 10;
done

Edit: let me stress this is FAR from ideal, calling the md5 function every 10 seconds has to be one of the daftest ways to implement this but it *does* work and for the use i needed it for the additional load is irrelevant

Want your say?

* Required fields. Your e-mail address will not be published on this site

You can use the following XHTML tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Your gravatar will be used if available.
If you don't have one - go get one - they're free!