0

Let's say I want this action to happen on any program whenever I press F10 (or some other custom key combination):

Paste the text: "Hello World!"

There's a similar tool in Windows called AutoHotKey but apparently it doesn't have a Mac equivalent.

Any idea how to achieve this on Mac?

4
  • Creating a service with Automator then bind it to a keyboard short cut could be an a solution Apr 6 '13 at 13:59
  • Matt, actually I've been considering Automator but I've never really understood how it works. Any idea how I can achieve this there?
    – Ronixus
    Apr 6 '13 at 14:42
  • See my answer below. I gave the full procedure to create such services and you them with the keyboard. Apr 6 '13 at 18:39
  • The MacOS native System Preferences > Keyboard > Text > Replace With shortcuts are a bit easier to add than separate keyboard shortcuts for each text: apple.stackexchange.com/questions/192343/general-autocompletion May 31 '20 at 0:23
2

Using Automator :

  • Create a new Service with automator
  • Select Service receives selected no input in any application
  • Add a Run AppleScript action

Copy this script :

on run {input, parameters}
  tell application "System Events"
    keystroke "Text to type"
  end tell
end run
  • Save your new service
  • In System Preferences > Keyboard > Keyboard Shortcuts > Services add a keyboard shortcut to your news ervice

NB: Replace "Text to type" by the text you want to add. Typing it will for example use directly the current style in apps like Word etc.

3

There is no option integrated into MacOS, but I think the software TextExpander is doing what you are asking for. You can specify shortcuts like "adr" to paste your whole address for example.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .