hauselin / obsidian-alfred

Alfred workflow for Obsidian note-taking app. Open vaults and files in Obsidian.
MIT License
500 stars 19 forks source link

Searching for a note opening it then quickly moving to another application then opens obsidian again #43

Open waynehoover opened 3 years ago

waynehoover commented 3 years ago

This is related to https://github.com/hauselin/obsidian-alfred/issues/23

When I search for a note open it, then quickly command tab away from Obsidian before the second notification, Obsidian opens up again losing my focus on the app I just switched too, this is pretty annoying. Anyway to make this double open of a note faster so this doesn't happen?

For now because I always leave Obsidian open anyways, I just commended these lines out in the "Open note in Obsidian" script:

// delay(3);  // temporary fix for Electron bug (open note twice)
// app.openLocation(uri);
hauselin commented 3 years ago

If the delay is shorter than 3 seconds, it sometimes might not work and could break other things. But if commenting it out works for you, go ahead and do that. It won't break anything else. As you've highlighted, this hack is to fix the annoyances described in #23.