MacOS – Moving the Caret with OS X Text Substitution

macostext;

You can set up text substitutions in OS X in the Languages and Text tab of System Preferences.

Is there a way to choose where the caret will appear after a text substitution takes place?

For example, when I type thx I want it to expand to Thank you |. where the | character represents where I would like the caret to be after the text has been substituted.

Right now when I set the shortcut thx to expand to Thank you ., and I type thx, it gets replaced with Thank you . |

Best Answer

I don't think it's possible. You might add a snippet like this in TextExpander though:

Thank you %|.

Or use DefaultKeyBinding.dict:

{
    "\UF704" = { // F1
        "t" = {
            "h" = {
                "x" = (insertText:, "Thank you .", moveBackward:);
            };
        };
    };
}