How to call x-callback-url scheme from JavaScript

Sharing and discussing custom actions for LaunchBar
lewiz
Posts: 1
Joined: Sun Jan 13, 2019 2:10 am

How to call x-callback-url scheme from JavaScript

Postby lewiz » Sun Jan 13, 2019 2:16 am

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

Return to “LaunchBar Actions”

Who is online

Users browsing this forum: No registered users and 1 guest