Type an abbreviations to get a long string

With APPLESCRIPT only, I would like to make abbreviations to type faster. In any application, if I type the short string (left side) followed by SPACE or TAB, I will get automatically the long string (right side). Can APPLESCRIPT do this, how?
Thanks in advance and regards.

CONFIG: iMac on Mac OS X Sierra 11.12

Welcome to Macscripter.

You’re asking if Applescript can watch all the text typed for any application and perform text substitutions (shortcut expansion)?

If it’s possible, it sounds messy and I wouldn’t recommend it. Unless maybe there are some Applescript Objective C tricks to implement it that I don’t know about.

Text Expander is for exactly what you want to do:


Although looking at that, it appears to be a subscription now? That’s annoying. It used to be something like $20 for a static license.

Here are alternatives:


You can do this using system preferences and it will work in every application that uses CoreText. I don’t think you’ll need AS at all.

Hey Sam,


AppleScript-only means building a slow service to run your AppleScript – or using a utility like FastScripts (which is better in my opinion).

The system’s text-replacement faculty is poor at best.

This is one of those cases when you really want a full fledged utility like Typinator.

I started using TypeIt4Me back when it first came on the scene, and it changed my computing life.

I gave it up back in 2008, because it wasn’t being updated very consistently at the time – and I picked TextExpander as the best-of-breed replacement.

Unfortunately TextExpander got really buggy after a couple of years, and in 2010 I found Typinator.

I’ve used Typinator quite happily ever since and have been very pleased with the responsiveness of the developers to bug reports and feature requests.


Because I use my abbreviations almost/only in Chrome, the extension ProKeys is perfect for my needs. And it allowes me to export/import my abbreviations to use them in Chrome on another iMac
Thanks in advance and regards