How to easily type a template without copy paste?

Several times a day I type the same URL (in text form) into website forms. I would like a simple script (or Automator action) that types the URL where I have a cursor placed.


You may find it easier to use text substitutions instead of using AppleScript or Automator.

Go to System Preferences > Keyboard > Text and, in the Replace and With columns, assigned the text you want to type and what it will be replaced with.

For example, type url1 to have it replaced with https://www.google.com as shown in the image below.

When you do type the Replace text, a small pop-up will show with the With text, press the Spacebar key to have the substitution take place, or the Esc key to cancel the action.

enter image description here


You can create an Automator service with an AppleScript included. A possible way to do it is with the following AppleScript:

tell application "System Events"
   keystroke "yoururl"
end tell

A detailed description how to do it is available under this link: http://www.mactricksandtips.com/2013/04/insert-text-with-a-keystroke-in-any-application.html