Hi all,
I figured since I was wrapping up (and backing up) the weekend's work,
I would send out a quick note to summarize my progress with NewtSync's
iCal plug-in.
Newton Dates and To-Do lists are stored in no less than five different
soups, depending on their type. These all have to be compacted into one
soup when syncing to the Mac and split back out when syncing from it.
The differing repetition formats are another hurdle; the Newton has an
overly complex method of storing this information, in the name of
saving a little space.
A big hurdle that I've had to overcome is communicating with iCal
itself. There seem to be three options for modifying iCal's data:
1) Reverse-engineer the OS X private CALCore framework which iCal uses
to write out its files. I ruled this out because Apple has no
disincentive not to change the framework at a moment's notice, and both
my NDA at Apple and the DMCA pose legal liability if I were to do this.
Plus, without headers and documentation, using the framework will prove
tricky at best.
2) Read from and write to the calendar files directly, circumventing
iCal completely. I considered this one, but the modifications probably
won't show up in iCal if it's currently running, and the only library
available to help parse this file is GPL.
3) Use AppleScript to communicate with iCal. This one's a little
slower, but it's the road I ended up taking. Why? Because it's
documented. I asked Dan Wood of Karelia Software how he creates dates
in iCal from Watson, and he uses AppleScript. So I figured this was the
best way to go.
Another hurdle is that there's no constant fields that I can use to
keep dates on the Mac matched up to dates on the Newton. Appointments
get rescheduled all the time, so the time at which the event occurs
isn't a good choice. So, the first time the sync is performed, NewtSync
will find dates whose start date & time and description match. Then
their unique IDs are "paired together" in NewtSync's cache, so that if
an appointment is moved, NewtSync will know to reschedule it. In other
words, here's what happens (for non-repeating dates anyway)
For each record:
1. Look in the cache to see if a matching record has been found during
a previous sync.
2. If not, look now for a matching record. If one is found, cache it.
3. If there's still no match, create new record and cache it as a match.
4. If there is a match, updated the matched record's information.
Got this going from the Newton to the Mac, and I'm working on Mac to
Newton now. Next comes repeating dates and date notes, then to-do
lists. Alarms aren't syncable because there's no way to access them via
AppleScript.
Anyway, I've been wordy enough, and this concludes my work for the
weekend :-) I've got work to do at Apple this week, but it is a short
week and it's a long weekend starting Thursday.
John Anderson
everchanging
-- This is the NewtonTalk list - http://www.newtontalk.net/ for all inquiries List FAQ/Etiquette/Terms: http://www.newtontalk.net/faq.html Official Newton FAQ: http://www.chuma.org/newton/faq/
This archive was generated by hypermail 2.1.2 : Mon Dec 02 2002 - 22:03:27 EST