• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
FastScripts Keyboard Shortcut Backup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FastScripts Keyboard Shortcut Backup


  • Subject: FastScripts Keyboard Shortcut Backup
  • From: Christopher Stone <email@hidden>
  • Date: Fri, 04 Sep 2015 11:17:41 -0500

Hey Folks,

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.

--
Best Regards,
Chris

-------------------------------------------------------------------------------------------
# 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
-------------------------------------------------------------------------------------------

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: FastScripts Keyboard Shortcut Backup
      • From: Yvan KOENIG <email@hidden>
  • Prev by Date: Re: El Capitan ?
  • Next by Date: Re: FastScripts Keyboard Shortcut Backup
  • Previous by thread: Re: El Capitan ?
  • Next by thread: Re: FastScripts Keyboard Shortcut Backup
  • Index(es):
    • Date
    • Thread