Allow passing variables via URL scheme

It would be very helpful to be able to pass a variable to a named trigger using the URL scheme.

For example, I want to be able to click a link to create a new file for a specific date. If I could write the URL as btt://trigger_named/?trigger_name=OpenDateFile&var=02/02/1967 I could do so easily.

Currently it looks like I would need to first click a link to create a persistent variable, then afterwards click another link to actually run my script.

Good idea, I have added this in 6.003 alpha (uploading)

1 Like

I didn’t find any details on that in the release notes or the online documentation. How would I access the parameter(s) from a named trigger?

they are saved in standard BTT variables, so you can e.g. access them via Java Script or Apple Script. (or in other places where variables are supported in BTT, e.g. advanced trigger conditions). What are you trying to do?

Wow, that was quick.

I’m trying to see if I can open an URL in a specific browser. Something like this:

btt://trigger_named/?trigger_name=whatever?browser=safari?url=https://spiegel.de

It’s not super important. The question arose in the DEVONthink forum if one could use browser-specific URL schemes to open an URL in a particular browser on macOS. Seems that this it not possible except for Edge, because no other browser provides an URL scheme (any longer). So, I started thinking about BTT…

The open url action supports choosing a browser and can handle variables in curly braces, so that might be easy:

open "btt://trigger_named/?trigger_name=open_in_safari&yourVariableName=https://spiegel.de"

You could of course also add a browser variable like in your example and then have some if conditions in the action sequence, but probably having one named trigger per browser is also fine

open "btt://trigger_named/?trigger_name=open_in_browser&browser=safari&browser_url=https://spiegel.de"

open_in_browser.bttpreset (6.1 KB)

//edit updated the preset due to a little config issue