A few years ago I had a crash that destroyed all of my FastScripts keyboard shortcuts.
To the best of my recollection that was the only time this has happened since I started using FastScripts in 2003, so I can't complain too much.
Nevertheless I've meant to figure out how to back those keyboard shortcuts up since then, and I've finally gotten around to it.
This is only the save part of the backup. I have yet to write the restore script, but that should be easy enough.
Originally I tried to save the list of lists {{keyboard-shortcut, script-item, script-file}, …, …} to a as-list in a data file, but when I added FS' script item class to the list it wouldn't write — and I don't know why. So I resorted to using a script-object to store the backup-list in, and that worked.
-------------------------------------------------------------------------------------------
# Hangs Script Debugger on my system but works fine from FastScripts or the Script Editor.
-------------------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2015/08/31 09:44
# dMod: 2015/09/02 06:48
# Appl: FastScripts
# Task: Backup FastScripts' Keyboard Shortcuts — Script Object Version
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @FastScripts, @Backup, @Keyboard_Shortcut
# Test: OSX 10.10.5
-------------------------------------------------------------------------------------------
script FastScripts_Keyboard_Shortcuts_Backup
property fsKeyBak : {}
on run
return fsKeyBak
end run
end script
-------------------------------------------------------------------------------------------
property fastScriptsKeyboardShortcutBackupList : ""
-------------------------------------------------------------------------------------------
with timeout of 15 seconds
set fsBackupFilePath to (path to desktop as text) & "FastScripts_Keyboard_Shortcuts_Backup.scpt"
tell application "FastScripts"
tell (script items where its has keyboard shortcut is true)
set scriptItemList to it
set scriptFileList to script file
set shortcutStringList to shortcut string of keyboard shortcut
end tell
end tell
copy shortcutStringList to fastScriptsKeyboardShortcutBackupList
set _cntr to 0
repeat with i in fastScriptsKeyboardShortcutBackupList
set _cntr to _cntr + 1
set (contents of i) to {contents of i, item _cntr of scriptItemList, item _cntr of scriptFileList}
end repeat
set fsKeyBak of FastScripts_Keyboard_Shortcuts_Backup to fastScriptsKeyboardShortcutBackupList
store script FastScripts_Keyboard_Shortcuts_Backup in fsBackupFilePath
end timeout
-------------------------------------------------------------------------------------------