Macro to Find Next *** on Screen

I am in the medical world and in the electronic medical records system they have a handy feature where you can create templates and have placeholders in the templates for areas that need to be filled in.

For example, I could have a phrase that get's pasted in like this:

Please go to the store and get *** bananas and *** apples

Then if I hit F2 it will select the first *** so that I can immediately start typing and replace that. If I hit F2 again, it will go to the next one in the list and then continue until it starts back over at the beginning.

Is there any way to do this with KM? I'm fairly comfortable with macro building, but have struggled to come up with something for this

You could try:

That will work in most Mac apps.

3 Likes

This works reasonably well in most mac apps with a few tweaks, thanks! Unfortunately it doesn't work with the apps I was trying to use it in (Notion and Anki)

1 Like

Check the apps and see if they have similar facilities in the Edit menu for things Like Find, Use Selection for Find, etc. You may be able to UI control them. For example:

  • Command-Up Arrow
  • Select Menu Edit ➤ Find
  • Pause
  • Insert Text by Typing "***%Return%"

It does sort of work, though not perfectly. It's not as smooth as I'd like and doesn't always work unfortunately (especially with having to put pauses in). I tried find on screen as well but that's not as great either

Notion is an Electron app, Anki uses qt -- such "non-native" apps are often more difficult to macro, unfortunately.