Page 1 of 1

How to call x-callback-url scheme from JavaScript

Posted: Sun Jan 13, 2019 2:16 am
by lewiz
JavaScript looks to be the preferred language for actions. I'd like to query another application on macOS but I do not know how to query a custom URI scheme.

When I try either of the following in my runWithScript():

Code: Select all

var data = HTTP.getJSON("bear:x-callback-url/tags")
var data = HTTP.getJSON("bear://x-callback-url/tags")

I receive the following in the log:

Code: Select all

default   16:03:39.671328 -0800   Test (Test): {"error":"unsupported URL"}

However, I can use the first syntax to *launch* the app:

Code: Select all

var data = LaunchBar.openURL("bear:x-callback-url/tags")

Am I doing something wrong and/or is there another way that I can query a custom URL scheme from JS? Thanks