• 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
Re: Restore FastScripts Keyboard Shortcuts from Backup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Restore FastScripts Keyboard Shortcuts from Backup


  • Subject: Re: Restore FastScripts Keyboard Shortcuts from Backup
  • From: Tim Nelson <email@hidden>
  • Date: Sat, 23 Apr 2016 22:40:27 -0700

HiĀ Chris,

Thanks for the tips and evermore handy script. I took your's and Daniels advice and wrote a script for replacing application preferences. It's not entirely clear to me if this will work in the case that a FastScripts database has been created in "~/Library/Caches", nor do I understand what conditions determine when Cache databases are created. I've seen FastScripts running with and without Cache databases. It just so happened that when I wrote this script a database was not present.


(*********************************************************************************

Task: Replace application preferences in Mavericks/Yosemite/El Capitan

**********************************************************************************)


use AppleScript version "2.4"

use framework "Foundation"

use scripting additions


set replacementPrefs to (POSIX path of ((path to desktop folder as text) & "com.red-sweater.FastScripts.plist"))

its replaceAppPrefsFrom:replacementPrefs forApp:"FastScripts"


##############################################

##### HANDLER

##############################################


on replaceAppPrefsFrom:sourcePrefs forApp:targetApp

tell application targetApp to quit

set fileManager to current application's NSFileManager's defaultManager()

set targetPrefs to (POSIX path of ((path to library folder from user domain as text)) & "Preferences/" & ((current application's NSString's stringWithString:sourcePrefs)'s lastPathComponent() as text))

fileManager's removeItemAtPath:targetPrefs |error|:(missing value)

fileManager's copyItemAtPath:sourcePrefs toPath:targetPrefs |error|:(missing value)

do shell script "killall cfprefsd"

delay 0.2

tell application targetApp to activate

end replaceAppPrefsFrom:forApp:

 _______________________________________________
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: Restore FastScripts Keyboard Shortcuts from Backup
      • From: Christopher Stone <email@hidden>
  • Prev by Date: Re: A folder for scripts to share
  • Next by Date: Re: A folder for scripts to share
  • Previous by thread: Re: Restore FastScripts Keyboard Shortcuts from Backup
  • Next by thread: Re: Restore FastScripts Keyboard Shortcuts from Backup
  • Index(es):
    • Date
    • Thread