Open Obsidian note in Noteplan and vice versa

I am using Obsidian in parallel with Noteplan, i.e. I told Obsidian that my vault is where my Noteplan notes are. (See this topic for more on this approach)

What I’m trying to do

I would like a one click (or keyboard shortcut) solution for switching to the other app respectively, i.e. I’m looking at a note in Noteplan - click - and that note opens in Obsidian and vice versa.

Things I have tried

I have achieved this manually for individual notes using URL the schemes for each app.

The link to open the note in Noteplan looks like this:

[Open in NP](noteplan://x-callback-url/openNote?filename=Note-name.md) 

And the link to open the note in Obsidian looks like this:

[Open in Obsidian](obsidian://open?vault=co.noteplan.NotePlan-setapp&file=Note-name)

So far so good. That’s the proof of concept. But what’s the best way of implementing this for all notes (or at least all new notes)?

The first that comes to mind is to include these links in all templates but I sense some trouble there because the filename usually changes after the note is created which means the link can’t be rendered upon creation. I haven’t looked into this any further because I sense that there is probably a better, more dynamic way of doing this, but I’m not sure how.

The most elegant solution would probably be to create a plugin for Noteplan and one for Obsidian. But while I like that this avoids any modification of the notes, I have no experience with plugins, so I’m not sure I’d be able to implement it.

So I’m leaning towards a template that I can manually trigger and which inserts the (hard coded) links into the current note.

Or perhaps it is possible to do this without hard-coding the link by using javascript?

Yet another approach might be to circumvent both Obsidian and Noteplan and use some external script to

  1. Check whether the active window is Noteplan or Obsidian
  2. Get the Filename of the currently open file in that window
  3. Tell the other app to open it.

Although Obsidian doesn’t support apple script, it might be possible to implement this nonetheless using this workaround.

Perhaps there are other ways… Any thoughts or advice on this would be appreciated.

Templater can be used to run arbitrary code, so you can create a Templater “template” that dynamically opens the current note in NotePlan.

Something similar could probably work in NotePlan.

1 Like

This is the approach I ended up implementing and it seems to work nicely so far:

Also Shell commands plugin can query current file name using {{file_name}} or {{title}} and then execute a shell command using open (mac) or Start-Process (windows/powershell).

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.