Open URL in the background

Hi, it'd be cool to have an action that can open the specified URL in the background - so without opening the browser itself. This could be done with the use of built in webserver, so that it'd make a request (but that'd require having it enabled for this action to work, so perhaps you know a better way)

Having an option to inlcude the current selection such in regular open url action would be awesome, too :slight_smile:

If I understood correctly you could use the run terminal command action and just use curl

curl -s  

Yeah, but is it possible to use the current selection like in open url action? I mean, I select the text in the browser, trigger a keyboard shortcut and the script could get the selection as a param somewhere? That's what I thought were missing

This is not yet exposed in the UI, but in the latest alpha you can save the selection to a variable and then use it apple script:

This creates a keyboard shortcut that does this:

  "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
  "BTTPredefinedActionType" : 256,
  "BTTPredefinedActionName" : "Save selected text to variable selected_text",
  "BTTAdditionalConfiguration" : "1835049",
  "BTTEnabled2" : 1,
  "BTTUUID" : "7A6F68BF-D043-4F0F-AA7B-57F9A6BEDC40",
  "BTTTriggerOnDown" : 1,
  "BTTEnabled" : 1,
  "BTTShortcutKeyCode" : 35,
  "BTTShortcutModifierKeys" : 1835008,
  "BTTOrder" : 7,
  "BTTAdditionalActions" : [
      "BTTTriggerType" : -1,
      "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
      "BTTPredefinedActionType" : 172,
      "BTTPredefinedActionName" : "Run Apple Script (blocking)",
      "BTTInlineAppleScript" : "tell application \"BetterTouchTool\"\r\tset xxx to (get_string_variable \"selected_text\")\r\tdo shell script \"curl -s https:\/\/\/?text=\" & xxx\rend tell\r",
      "BTTEnabled2" : 1,
      "BTTUUID" : "A66DD507-E88B-4F38-854D-D02C0E512337",
      "BTTEnabled" : 1,
      "BTTShortcutKeyCode" : -1,
      "BTTShortcutModifierKeys" : -1,
      "BTTOrder" : 65
1 Like

Quick question - do you plan on a way to get a list of defined variables somehow?