[SOLVED] URL Scheme Trigger?

SOLVED: ccstone had the answer:

There's an old Preference Pane called RCDefaultApp that gives a whole lot of control over default apps.

This fixed things perfectly - now my nv:// urls open Notational Velocity instead of nValt.

ORIGINAL POST:
I maintain two note repositories: one for product development and another for general scratch pad-type notes. I keep the product development notes in Notational Velocity and the rest in Nvalt. (Important to note, NValt is a branch of Notational Velocity.)

I copy the URL of individual notes and paste them into my todo list. The Notational Velocity URLs start with

nv://

and the Nvalt URLs start with

`nvalt://

However, when I execute a URL starting with nv:// it opens NValt instead of Notational Velocity.

How do I fix this? Can someone tell me:

  • Is there a way I can fix the URL (maybe through the OS?) so that it opens the correct app?

  • Can KM be triggered by the nv:// URL and then use the URL data to open a search in the correct app?

Thanks in advance for your help.

"I copy the URL of individual notes and paste them into my todo list"
It is not clear how you use KM to insert the note.

Are you using Open URL action ?

?

Sorry for being unclear. The reason I want to involve KM is that the URL intended for Notational Velocity is being opened by the wrong app when I double-click on it in my to do list. If I can't adjust this in the Terminal somehow, I was asking if KM could help.

I was wondering if KM could use the nv:// URL as a trigger to open Notational Velocity and pass along the search parameters from the URL.

Okay, try this way first
try inserting the data in Using Open URL action in KM and see if work ... if it works , this macro can be called from terminal (or execute script)

Let me rephrase the question:

Is there a way to trigger a KM macro when a URL file link is opened in another app?

I don't think that KM can intercept action of other app this way. unless there that there is context menu to open the link in other app and copy the link and then send it to KM for processing. These can be done by hot key trigger.

but before even doing this, see if that Open URL action work first, as no point to let KM process it if its action didn't help.

1 Like

Hey @anamorph,

You did set the app in the open URL action – yes?

image

If you can't make that work you might be able to make the NV version of this work:

tell application "nvALT"
   open location "nvalt://find/Contact/?NV=fj8%2FKX48TD%2BjGTsIwJGDTA%3D%3D"
end tell

-Chris

Thanks much for the help. I need a solution for the other direction --

I want to click on an nv:// link in an app like Things and have the URL trigger KM so it can redirect the URL to the correct app.

Alternatively, do you know how to tell the MacOS to open nv:// links with the correct app? Is there a pref setting or something I can tweak in the Terminal?

Thanks!

Whups. I missed that, and I somehow missed the rest of the thread it seems...

You could try rebuilding launch services with Onyx or some other utility, but I would NOT bet that it will help.

The two apps have different Bundle-IDs, but they share the same creator code:

Long Version       :  2.0 β5, Copyright © 2011 Zachary Schneirov, All Rights Reserved.
Bundle Identifier  :  net.notational.velocity
File Type          :  APPL
File Creator       :  N†l√
                       
Long Version       :  nvALT by David Halter and Brett Terpstra, based on NV 2.0 β5 Copyright © 2010 Zachary Schneirov, All Rights Reserved.
Bundle Identifier  :  net.elasticthreads.nv
File Type          :  APPL
File Creator       :  N†l√

There's an old Preference Pane called RCDefaultApp that gives a whole lot of control over default apps.

image

As you can see nvALT registers both URL-schemes.

I can change that in the preference panel, and it does work here on Mojave.

What version of macOS are you running? It may or may not run the pref-pane, and for that matter you probably can't find it anywhere as it's no longer supported.

However – I still have a copy in my software archive.

I have a vague memory of the possibility of making these sorts of changes either via the Terminal or via editing a system file, but it's been years since I looked into such things.

-Chris

Chris, Thanks for the rescue!

I'm on Mojave, too, and I found RCDefaultApp on MacUpdate. Works perfectly, and solved the problem.

1 Like