# hacking iCal



## iGuy (Mar 3, 2003)

iCal  keeps its data in a textfile (whatever.ics).  This Unicode file is easily understood -- with one problem.  Each entry is given a unique tag (the UID).  This identifier is the same for all instances of the event if it repeats.

I have written an application that can read and write into the file, and hence display as an event on the calendar.  But, to do this I make up the UID.  I have no idea what algorithm Apple is using to generate this UID. Judging from the complexity if the UID, I would suppose it has other proposes than just a tag for the entry -- so I would not care to use random UIDs  in the final app.

It would be really good to have a program that would read from my database (another app) and write my calendar for me.  I have written the code, and except for this,  am ready to run it with real data.

Does anyone have an idea where I might find the info I am looking for?

TIA


----------



## adambyte (Mar 3, 2003)

I have no frickin' clue, as I am no programmer, but there IS a person who wrote a menu bar widget called "MiCal" which shows all the events of the day in a little menu... so whomever programmed THIS probably knows....

http://www.versiontracker.com/moreinfo.fcgi?id=17296&db=mac


----------



## LordCoven (Mar 6, 2003)

I'd also be interested to know this, as I'm planning on writing some synching software for Zaurus -> OS X when I get the time 
So please post here again if you ever find out 

C


----------



## iGuy (Mar 7, 2003)

The following is courtesy of Scott of MiCal (e.g. the iCal Menu application producer):

" I have seen UIDs generated by other programs that are quite different than Apple's UID.  I have not double checked the specification (which is something you should do), but my GUESS is that the spec would state that any app dealing with .ics files would have to honor a different UID format of any other application (assuming that they were truly unique in nature).  IF that is true, then you could use whatever algorithm you choose to generate UIDs.  There are repositories of info and sample code on how to generate a globally unique ID available on the net.  If you look at Apple's UIDs, you'll note that for the same machine and probably the same user, there are segments of their UID that are always the same, and then there are others that vary probably with time, and probably a pseudo-random component as well.

The definitive resource for the questions you are asking would be the specifications, which can be found here:

http://www.ietf.org/rfc/rfc2445.txt
http://www.ietf.org/rfc/rfc2446.txt
http://www.ietf.org/rfc/rfc2447.txt
"


----------

