Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Merge/import older iCal files to newer iCal?

I'm trying to merge/import old iCal files from a circa-2005 iMac to my MacBook Pro (purchased in Dec. 2010). The files were pulled directly from the iMac onto an external hard drive, before the failing iMac stopped working completely. My iCal won't recognize the old files for importing. I just came back from the local Apple store Genius Bar, and the person there was stumped in whatever he tried. Is there a method for resurrecting these older iCal files? Thanks very much in advance for any help offered.

Posted on Feb 16, 2012 9:32 AM

Reply
19 replies

Feb 20, 2012 1:49 PM in response to MrMur

Hi MrMur,


The .icalevent files are 'metadata' files used to help Spotlight index your data in OSX 10.4. They do not contain enough data to give you any more than basic information for an event. For example they do not store the repeat pattern of an event. The information could be extracted (I did it using Applescript), but it would never have held the full event information, just what Spotlight needed.


The better files to get from the old OSX 10.4 backup are in ~/Library/Application Support/iCal (where ~ is the path to the old User's Home folder). Buried in there would have been one corestorage.ics file for each calendar. Do you still have the contents of that folder?


Best wishes

John M

Feb 21, 2012 9:20 AM in response to John Maisey

Hi, John,


Alas, the iMac on which the corestorage.isc files resided is no more and has departed this life. I'm afraid all I have left are the memories and the .icalevent files. I guess I did a sloppy job of rescuing things before my iMac went screen-up.


Happily, my goal is to simply to retrieve basic information from the .icalevent files showing what I had typed into a day's file (for instance, "2 pm doc appointment"). Being able to get that info into my iCal would give me a valuable record of past events and activities. I don't know if that's what you were referring to by "metadata." If so, is it a relatively simple task using Applescript to mine that data and make it attachable to my current iCal?


Thanks for all your help.


MrMur

Feb 21, 2012 3:34 PM in response to MrMur

Hi,


Try the script below and let me know how it goes.


Open Applescript Editor (Applications/Utilities/Applescript Editor) copy the script below into a new window and press the Run button. A window to select the folder where the files are stored will appear. Navigate and select the folder containing your files.


As mentioned above you will only recover the title, notes and time of the events from the .icalevent files.


Best wishes

John M



----------------------------------------------
-- John Maisey -- www.nhoj.co.uk -- 21 Feb 2012  --
----------------------------------------------
set {myList, myCount, myFailures, calName} to {{}, 0, 0, "Recovered Events"}
tell application "Finder" to set myPath to choose folder default location (path to desktop)
set theFolders to my getSubFolders(myPath, {myPath})

tell application "System Events"
          repeat with myFolder in theFolders
                    set myFiles to (files of myFolder whose type identifier is "com.apple.ical.bookmark")
                    repeat with thisFile in myFiles
                              set end of myList to (value of property list file (POSIX path of thisFile))
                    end repeat
          end repeat
end tell

tell application "iCal"
  activate
          if name of calendars does not contain calName then make new calendar with properties {name:calName}
          repeat with myEvent in myList
                    try
                              make new event at the end of events of calendar calName with properties {summary: (|summary| of myEvent), start date: (dueDate of myEvent), end date: ((dueDate of myEvent) + 1 * hours), description: (comment of myEvent), allday event: (fullDay of myEvent)}
                              set myCount to myCount + 1
                    on error theErr
                              set myFailures to myFailures + 1
  display dialog theErr
                    end try
          end repeat
          display dialog (myCount & " of " & (myCount + myFailures) & " events recovered to iCal") as text buttons {"OK"} default button "OK" with title "data recovery" with icon 1
end tell

on getSubFolders(myPath, mySet)
          tell application "System Events"
                    set myArray to folders of myPath
                    repeat with myItem in myArray
                              set mySet to my getSubFolders(myItem, mySet)
                              set end of mySet to (path of myItem) as alias
                    end repeat
          end tell
          return mySet
end getSubFolders

Feb 23, 2012 10:39 AM in response to John Maisey

Hi, John,


The script did not work, unfortunately. It ran and concluded with the iCal data recovery message of "0 of 0 events recovered to iCal."


Just to be certain, I went back in the iCal calendar to the dates contained in the iCal events involved (I used two test files that I had copied from older iCal events) but found no entries.


The script DID create a new Calendar Group called "Recovered Events," so it seems to have functioned to a certain extent.


Thanks very much for the script, though. I appreciate the effort and thoughtfulness. It does appear to be quite a script -- I hope it wasn't one you worked on just for this.


MrMur

Mar 1, 2012 10:08 AM in response to John Maisey

I apologize for that, John. Apparently, images can't be copied into the message area.


The error message started with "Can’t get comment of {entityID" then ran a long string of numbers that did not appear to relate to anything I could discern, then "summary”Work night" ("Work night" was the actual text I had entered into the calendar that day), then "privateID" with a repeat of the earlier number string, "then

dueDate:date “Monday, August, 7, 2006 12:00 AM”, attendees:{}}." That is the date for which I had entered "Work night."


MrMur

Mar 1, 2012 2:52 PM in response to MrMur

MrMur wrote:


The error message started with "Can’t get comment of {entityID"...


I see. Try this one and let me know how you get on.



----------------------------------------
-- John Maisey -- www.nhoj.co.uk -- 21 Feb 2012
-- Modified 1 Mar 2012 
----------------------------------------
set {myList, myCount, myFailures, calName} to {{}, 0, 0, "Recovered Events"}
tell application "Finder" to set myPath to choose folder default location (path to desktop)
set theFolders to my getSubFolders(myPath, {myPath})

tell application "System Events"
          repeat with myFolder in theFolders
                    set myFiles to (files of myFolder whose name extension is "icalevent")
                    repeat with thisFile in myFiles
                              set end of myList to (value of property list file (POSIX path of thisFile))
                    end repeat
          end repeat
end tell

tell application "iCal"
  activate
          if name of calendars does not contain calName then make new calendar with properties {name:calName}
          repeat with myEvent in myList
                    try
                              set thisEvent to make new event at the end of events of calendar calName with properties {start datedueDate of myEvent), end date:((dueDate of myEvent) + 1 * hours)}
                              try
                                        set summary of thisEvent to |summary| of myEvent
                              end try
                              try
                                        set description of thisEvent to comment of myEvent
                              end try
                              try
                                        set allday event of thisEvent to fullDay of myEvent
                              end try
                              set myCount to myCount + 1
                    on error theErr
                              set myFailures to myFailures + 1
  display dialog theErr
                    end try
          end repeat
          display dialog (myCount & " of " & (myCount + myFailures) & " events recovered to iCal") as text buttons {"OK"} default button "OK" with title "data recovery" with icon 1
end tell

on getSubFolders(myPath, mySet)
          tell application "System Events"
                    set myArray to folders of myPath
                    repeat with myItem in myArray
                              set mySet to my getSubFolders(myItem, mySet)
                              set end of mySet to (path of myItem) as alias
                    end repeat
          end tell
          return mySet
end getSubFolders

Mar 4, 2012 12:59 PM in response to John Maisey

Hi, John,


"Without seeing the data you have feels a bit like playng darts in a dark room. 🙂"


Some of my most successful darts games have been in the dark -- although the people standing nearby didn't always agree. 🙂


The latest script didn't seem to get as far as my test files. I got a puzzling "Syntax Error" message that stated: Expected "," or "}" but found identifier.


MrMur

Mar 4, 2012 1:22 PM in response to MrMur

The forum's greedy emoticons stole a :( from the script. 🙂


Try:


----------------------------------------
-- John Maisey -- www.nhoj.co.uk -- 21 Feb 2012
-- Modified 1 Mar 2012 
----------------------------------------
set {myList, myCount, myFailures, calName} to {{}, 0, 0, "Recovered Events"}
tell application "Finder" to set myPath to choose folder default location (path to desktop)
set theFolders to my getSubFolders(myPath, {myPath})

tell application "System Events"
          repeat with myFolder in theFolders
                    set myFiles to (files of myFolder whose name extension is "icalevent")
                    repeat with thisFile in myFiles
                              set end of myList to (value of property list file (POSIX path of thisFile))
                    end repeat
          end repeat
end tell

tell application "iCal"
  activate
          if name of calendars does not contain calName then make new calendar with properties {name:calName}
          repeat with myEvent in myList
                    try
                              set thisEvent to make new event at the end of events of calendar calName with properties {start date: (dueDate of myEvent), end date: ((dueDate of myEvent) + 1 * hours)}
                              try
                                        set summary of thisEvent to |summary| of myEvent
                              end try
                              try
                                        set description of thisEvent to comment of myEvent
                              end try
                              try
                                        set allday event of thisEvent to fullDay of myEvent
                              end try
                              set myCount to myCount + 1
                    on error theErr
                              set myFailures to myFailures + 1
  display dialog theErr
                    end try
          end repeat
          display dialog (myCount & " of " & (myCount + myFailures) & " events recovered to iCal") as text buttons {"OK"} default button "OK" with title "data recovery" with icon 1
end tell

on getSubFolders(myPath, mySet)
          tell application "System Events"
                    set myArray to folders of myPath
                    repeat with myItem in myArray
                              set mySet to my getSubFolders(myItem, mySet)
                              set end of mySet to (path of myItem) as alias
                    end repeat
          end tell
          return mySet
end getSubFolders

Merge/import older iCal files to newer iCal?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.