Auto-backup of the Stickies database

Jan 22, '02 09:12:18AM

Contributed by: james_sorenson

This AppleScript maintains three backups of the Stickies file to compensate for the occasional lost Stickies problem in MacOS X.

Save this script as an application (from ScriptEditor) and use it to start-up Stickies in your Login items. It will rotate the backups before starting. I maintain multiple backups in case you log in more than once before noticing that your stickies file has been swiped clean.

Read the rest of the article for the script.

File Information:

Original file
~/Library/.StickiesDatabase

Backup Files
~/Library/Application Support/Stickies/StickiesDatabase.1 (most recent)
~/Library/Application Support/Stickies/StickiesDatabase.2
~/Library/Application Support/Stickies/StickiesDatabase.3 (oldest)

The AppleScript

--Begin AppleScript--

try
do shell script "mkdir ~/Library/Application\\ Support/Stickies"
end try

try
do shell script "cp ~/Library/Application\\ Support/Stickies/StickiesBackup.2 ~/Library/Application\\ Support/Stickies/StickiesBackup.3"
end try

try
do shell script "cp ~/Library/Application\\ Support/Stickies/StickiesBackup.1 ~/Library/Application\\ Support/Stickies/StickiesBackup.2"
end try

try
do shell script "cp ~/Library/.StickiesDatabase ~/Library/Application\\ Support/Stickies/StickiesBackup.1"
end try

tell application "Stickies"
activate
end tell

--End Apple Script--
NOTE: The "cp" script lines are wrapping; they should be entered as one line in the script. To restore your stickies, just copy one of the backup files over the original .StickiesDatabase.

Comments (15)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20020122091218796