Inbuilt text shortcuts

I love Scrivener! I write long, and sometimes complex books, and Scrivener has changed the way I write for the better. Thanks.

At the moment Scrivener uses Mac’s built in text shortcut function (in System Preferences/Keyboard/Text). But this function has serious problems. Frequently the shortcut lists disappear, reappear, change—with no explanation. Judging from advice online, there is no real solution to this problem, and it significantly affects my writing as I depend on dozens of shortcuts.

Could Scrivener include its own, built in, text shortcut facility? Word has its own, and this issue alone has tempted me to go back to Word. I would love Scrivener to bypass this Mac problem by supplying its own solution.

Thanks.

That would be a large amount of coding and UI design to reinvent an existing wheel (occasionally temperamental though it may be).

Fortunately keyboard shortcuts are pretty easy to store and restore later on. They are saved into each application’s preference file, and those have multiple mechanisms available for either manually editing or using the standard system mechanisms for working with them (the same mechanisms Scrivener itself uses to read and write to its own preferences file). I’ve been doing this for years now, as I frequently have to reset Scrivener preferences and got tired manually creating the dozens of shortcuts I add, over and over.

[size=120]Backup[/size]

Here’s what you want to do:

  1. Switch to Finder and hit Shift-Cmd-U or use the Go/Utilities menu command.

  2. Load Terminal.app.

  3. Copy and paste the following command into the shell and hit the Return key to execute the command.

defaults read com.literatureandlatte.scrivener2 NSUserKeyEquivalents > ~/Desktop/scrivener_shortcuts.txt
A file called “scrivener_shortcuts.txt” should appear on your Desktop after executing the command. Set that file aside as your backup, wherever you prefer.

[size=120]Restore[/size]

(Until you are comfortable with the procedure, you might want to back up your Scrivener .plist before restoring by creating a copy on the Desktop or somewhere else convenient.)

  1. Following the same procedure above, open Terminal alongside the text file we saved.

  2. Copy and paste the following into Terminal, but don’t press Return yet:

defaults write com.literatureandlatte.scrivener2 NSUserKeyEquivalents '

  1. After the single-quote at the end of the line above, paste in the contents of the text file. After doing so, type in another single-quote and then press Return.

  2. To reset the preference cache, either log out and back in, or use the following shell command:

killall -u $USER cfprefsd

  1. Restart Scrivener and you should see your shortcuts all restored.

And of course this technique works with any program on the Mac that uses native tools (might not work with ported software such as Word).

Another way would be to get the Alfred app and use it’s Snippets function. It works in all apps that you allow it to work in.

Thanks to you both!