"Insert Text" Weirdness With Obsidian (Electron Issue?)

I use Keyboard Maestro for text snippets (similar to TextExpander), but I'm getting some strange behavior from Obsidian.

If a return character immediately follows the text insertion point (last item in a paragraph or a new line with content below) a typed string trigger executes the "insert text" action twice, but a hotkey trigger doesn’t.

Same result with insert by pasting or typing.

Based on some other "insert text" posts, I tried adding an Action Delay action to slow down the typing and got the same result. However, when I slowed it down to 0.1 I could see that the first insertion ignores the delay and appears instantly, but the second insertion types it out character by character.

Is this weirdness because Obsidian is an Electron app?

I haven’t the foggiest, but I wonder if using a pause 0.1 seconds at the beginning of your macro does the same thing?

Sounds like the weirdness is in your macro but who can tell until you post your macro for us to see?

Hey Russell,

I don't seem to have any problems with Obsidian 1.1.9 on macOS 10.14.6.

I tested with both Keyboard Maestro and Typinator.

  • Please post a test-case macro, so we can try to replicate the issue.
     
  • Why are you inserting a Return character instead of a Linefeed?
    • Do you have any plug-ins that respond differently to a Return?

Usually with this sort of issue I find a conflict with either the built-in macOS text-expansions or another app.

-Chris

Thanks. Here's the macro...

Home street.kmmacros (1.5 KB)

That worked fine for me (tested in several applications). Have you perhaps set up the string to trigger a macro in another application also, and forgotten about? Try changing the string trigger, else turning off Keyboard Maestro temporarily plus of course the standard debugging checklist...

I didn't realise Keyboard Maestro was an Electron app! I checked, and indeed it is. ...n't....

[edited 2023-03-27 lest my thinko there confuses anyone later]

Obsidian's an Electron app. It's the only app I’ve found that has this problem. Not Notes, Text Edit, BBEdit, Mail...

And I think I’ve found the problem. Long ago, I set up some of my most-used snippets in the system settings/keyboard/text replacements so they would be available on my phone. It seems the real Mac apps can deal with the same snippet trigger in both Keyboard Maestro and Text Replacements. But Obsidian chokes on it.

I began all my triggers with the letter "j" because not many English words start with J, it’s fast to type (especially not having to go to another keyboard on the phone for a semicolon, comma and the other characters people often tout to begin snippets). I’ll just change the Text Replacement snippets to start with something other than J, and adapt when on the phone. I don’t use them much there, anyway.

Thanks for your help,
Russell

P.S. I’m really surprised Keyboard Maestro's Electron. I wouldn’t think an Electron app could dig so deeply into MacOS.

1 Like

Huh? Where'd you get that?

Keyboard Maestro is a fully native macOS app.

How exactly did you check?

1 Like

Either you've been lucky, or Apple has improved text-handling in macOS.

On Mojave I have the occasional conflict between Keyboard Maestro and macOS text-expansions that I have to fix.

When a text-expansion is glitchy that's the first thing I check.

By being awake too late and confusing the names "Keyboard Maestro" with "Obsidian" for a moment! :person_facepalming: Sorry, those two apps are so intertwined in my hour-by-hour usage, it was like seeing two (very different) friends in the same place... or using both halves of my substitute for a properly working brain at the same time (not much exaggeration)....

No, Keyboard Maestro is not an electron app (I mean, come on...). Here's how one can check, when awake: How to know if a desktop app uses Electron - Cameron Nokes

1 Like

Yep, that's because I confused KM and Obsidian for a minute, sorry! :crazy_face:

No problem! Thanks.