Another option for creating a snippet from the cliboard

I really like being able to create a new snippet from the clipboard but/and would like to request an option. As I work and find myself mistyping the same word repeatedly. It would be nice to be able to select the misspelling (or an intentional abbreviation), copy it, then hit a hotkey to created a snippet with that as the abbreviation, rather than as the text to be returned. Example:

Say I consistently mistype the word “mispelled". I’d like to be able to copy “mispelled” to the clipboard, then hop into textexpander to create the snippet to auto-correct it. Basically the opposite of what the current shortcut does.

Does this make sense to anyone else?

I recently discovered textexpander and have come to rely on it very heavily at work. Thanks for any feedback anyone has.

2 Likes

Back in the day, when Textexpander was a native Mac app, you could have probably done this with AppleScript as it was then scriptable. However, as far as I’m aware, there are no “hooks,” into Textexpander, programatically, any longer.

What you could however do is some scripting of the UI to achieve. So, if on a Mac, a hotkey triggers a Keyboard Maestro macro…

  • On trigger, it simulates the global keyboard shortcut you have configured in Textexpander for creating a new snippet
  • Then, in that window, it tabs down twice to the abbreviation field and pastes “mispelled,” from the clipboard, into it
  • It then tabs back up to the field for the text to be expanded and puts “mispelled,” in there again for you to correct and then close the window

Edit - And just to flag, if you are a Popclip user, you could call this Keyboard Maestro macro from a Popclip snippet. You’d just need to add another simulate keystroke step at the start for command+C, for copy. Then when highlighting text for the abbreviation, click on your Popclip action and it will all happen as outlined above.

Below is a sample snippet, running the KM macro via a URL scheme. More on snippets here.

# popclip

name: TE Abbreviate
Icon: TA
url: kmtrigger://macro=B92E4F17-3C6A-4D89-A2F0-7E1C5B9D6438

Edit 2 - Thinking about this again, it can all be achieved within Popclip itself without requiring calling a Keyboard Maestro macro. Not sure why I didn’t think of this in the first place.

#popclip
name: TE Abbreviate
icon: TA
before: copy
key combo target: session
key combos:

- ctrl cmd n
- wait 1000
- tab
- tab
- command v
- shift tab
- shift tab
- command v
2 Likes

Hi @KenGranger ,

This makes total sense, and it’s a great way to think about it. Right now that hotkey drops your copied text into the Content field (the text that gets typed out), not the Abbreviation field, so there isn’t a one-step way yet to go straight from “copy the typo” to “correct it automatically.”

I really like this idea for a future option, essentially a “Create Snippet from Clipboard as Abbreviation” mode. I’ll pass it along to our product team as a feature request. Thank you for taking the time to share it, and thank you SO MUCH for being the best part of TextExpander! I hope you have a great day!

All the best,

-Nick

1 Like

Thanks for this suggestion. Yes, I use PopClip (and LOVE it)…I’ll give this a try.

Thank you, Nick. I appreciate your support. I can’t wait to get the Conditional capabilities! I use TE constantly at work and it has made things SO much easier.

All you need to do to add to Popclip is highlight that entire script and Popclip will recognise it as a new action and ask you is you want to add it. Obviously, if you are not using ctrl cmd n as the global keyboard shortcut to invoke Textexpander’s Create new snippet window, then you will need to copy and paste that script into an editor, correct your hot key, and then reselect the whole script to add to Popclip.

1 Like

Just got this working in PopClip and it’s exactly what I was looking for! Thanks for the workaround until such time as Nick’s team gets it added!

1 Like