Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.5: One way to recover from an Address Book crash' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: One way to recover from an Address Book crash
Authored by: Fred E. Webber on Dec 04, '07 12:23:20PM
Having had this exact problem one too many times when syncing various gadgets, I wrote this AppleScript to back up the Address Book data:

set theDate to find text "(.+)/(.+)/(.+)" in (short date string of (current date)) using {"\\3_\\2_\\1"} with regexp and string result
tell application "System Events" to set strHome_path to the home directory of current user
set strWorkingDir to strHome_path & "/Library/Application\\ Support/"
set strTheOrigin to strWorkingDir & "AddressBook"
set strTheDest to strWorkingDir & "AddressBook_BU" & theDate & ".tgz"

with timeout of 3600 seconds
	do shell script "tar -zcf " & (POSIX path of strTheDest) & " " & (POSIX path of strTheOrigin) & ""
end timeout
Paste it into a "Script Editor" document and save it as an application to where ever it's convenient.

[ Reply to This | # ]