The reason that I bring up Alfred is because you can create this same exact workflow within Alfred and assign it to a system wide hotkey all within the same application without writing and code at all (if you consider the example that I just gave to actually be writing code).
Within Alfred you can do things such as copy text from one place, then copy more text from somewhere else and append them together, do anything that you can do in Spotlight search, plus much, much more. It can completely take over spotlight for you (in fact I deleted the hotkey to bring up spotlight search (cmd + space) and assigned that hotkey to open Alfred instead. At this point I would probably be lost without it. There is also a tool called Alfred that is outstanding I use it many times on a daily basis. This is probably the easiest way of accomplishing your desired task while writing the least amount of code as possible. Hold down your desired keyboard shortcut and it will automatically assign this workflow to your selected hotkeys.In the right pane, search for the name of the Automator workflow that you just saved and click on the checkbox to the left of the file name.Scroll down to and select Services in the left pane.Once you find that, drag "Run AppleScript" over to the right pane, which enters it into your workflow.įinally, use System Preferences to assign this workflow to a global hotkey.Under "Actions" in the left pane, search for "Run AppleScript.".Next, use Automator to trigger the above AppleScript: Replace "Hello World." with your desired text, but make sure to keep the quotation marks around whatever text you input as that is what is making the data type a string. There is no shortcut key to remember in this instance, just the short text you want "corrected." (How you create Autocorrect entries has been discussed in other issues of WordTips.You could create this using AppleScript and run it using Automator.Ĭreate a script: tell application "System Events" to keystroke "Hello World." In other words, the program can "correct" the characters cj, replacing them with the longer sentence.
All you need to do is come up with a non-ambiguous series of keystrokes, such as cj, and then have Word replace that text with something else. Perhaps the easiest alternative, however, is to create an AutoCorrect entry for your text. The macro could then be assigned to a shortcut key and would be replayed (again typing the text) anytime you invoke the shortcut key. You could, of course, record a macro of you typing the desired text. There are other options besides using AutoText, however.
Word displays the Customize Keyboard dialog box. At the left of the dialog box click Customize (Word 2007) or Quick Access Toolbar (Word 2010).In Word 2010 display the File tab of the ribbon and then click Options.) (In Word 2007 click the Office button and then click Word Options. Define your AutoText entry as you normally would.If you want to have a special shortcut key for a particular AutoText entry, you can follow these steps: Word expands the mnemonic to its longer form. Once you create the AutoText entry, you can type the mnemonic for the entry and press F3. Brendan knows about AutoText, but he can't see a way to assign a shortcut like Ctrl+J to a particular AutoText entry.Īctually, AutoText includes sort of a built-in shortcut key. This would mean every time he hits Ctrl+J it would paste that sentence. Brendan would like to know if there is a way to assign a shortcut of my choosing, say Ctrl+J, to a sentence.