Work in progress and alpha features

@Alex_Tsalyuk seems to work fine here. What kind of device are you toggling? Can you connect manually?

v. 3.341

Applescripts do not seem to be triggering properly (and with versions previous this morning). Always run when widget becomes visible does not seem to work reliably and only after waiting for the "execute every x seconds, I get results.

Seems to work fine here, could you post one example config that doesn't work?

Looks like I am getting results after all, its the Alt color Regex is not working properly.

Im noticing this for my "icon indicators", display different font color based on active or not.

These are pretty custom, and most likely not work on your system. I can share one (my Time Machine Backup preset - SHARED HERE) it has an indicator Icon using Alt Color Regex.

Ah I think I can reproduce, it only updates the color on the second run of the script, correct?

That sounds about right. When visible doesn't show, but when timed after x seconds, it shows. So I would guess, yes, second time script runs.

Also found another "bug". Not sure its actually a bug, but what I expected is not happening.

Created a Webview Button, added an action to Delay 5 seconds, then 2nd action to paste text. When clicking Webview, nothing opens, it is waiting for that delay first.
Expected: Webview to open, then delay 5 seconds, then paste text.

Note: Ive seen this before when trying to have AppleScript popup notifications as a 2nd action.

Unfortunately the delay option is hard for actions that show UI because that's usually an async process. Maybe it works a little better with 3.342 but in general to modify content of the website it would probably be better to use java script.

The webview allows to specify a java script that is executed when the site has been loaded:

Looks like you fixed the AppleScript issue. :+1:

The delay action... simply wanted to allow a page to load before trying to enter some text into an in-focus field. Not a big deal, just strange the delay action stops the webview (primary action) from opening.

Yep, I have some plans on how to change the delay option, but it's a pretty big change affecting lots of things (it sounds easy, but pausing action execution is pretty tricky).

However in your case the user script option could work well, you can either trigger any BTT scripting function from it or directly access the text field and modify its value:


E.g. call a named trigger when the site has loaded:

callBTT('trigger_named',  {trigger_name: 'test', shared_secret: 'someSecret'});
1 Like

just a quick one @Andreas_Hegenberg

It appears you've missed documenting the variable "BTTinternalnightshiftstate:

1 Like

Hi Andreas, the BTT_PRESET_PATH is working in actions but not in widgets, is it expected?

Moreover, I'm having a trouble running a python script that located in BTT_PRESET_PATH.


I tried to get rid of -c parameter, no error but also no result, there's only a print() in hh.py, and it's working in terminal.

Am I missing anything?

The easiest way would be to go through /bin/bash.
Problem is that the -c parameter will require the script to be entered directly into BTT, not a reference to a file.

It also seems to work in the widget here:

In theory it should also work like this:


But there is a bug in the script runner which breaks this for paths with spaces. This will be fixed with the next alpha.

1 Like

Thanks! I’ll give it a try😄

Hi Andreas, can BTT render the button if I put <html> content in JSON string, e.g. {“text”:”<html>...</html>”}.

My BTT_PRESER_PATH contains space and I didn’t encounter any issues in the shell widget, but in AppleScript, BTT_PRESER_PATH_ESCAPE doesn’t seem to escape space, do shell script will always fail, is this the bug that you found?

Yes, I think this should work.

Cool, I would give a try in daytime,

It worked!
Can we expect <div> support in the future?

I am currently working on a preset that can display network speed on touch bar, it's almost finished, all I want is to display the following style:
image

<html>
<head><meta charset="utf-16">
</head>

<span style="color: white; font-family: Helvetica Neue; font-size:10px">

<div style="height: 20px;">
    <div style="height: 20px; float: left;">
        <span style="color:#357CA3; font-size: 20px">
            <b>Total&nbsp;</b>
        </span>
    </div>
    <div style="height: 12px">
        ▲437.5 B/s
    </div>
    <div style="height: 12px">
        <span style="color:#34CC46">
            ▼213.8 B/s
        </span>
    </div>
</div>

</span>
</html>

I noticed you said it only support basic CSS, but I really hope this can be supported, otherwise, we have to create 2 buttons to achieve the same goal (one for bigger font, one for double line), and it will not be performance efficient if they are script buttons.

Or, are there some other hidden tricks that can do this :smirk:?

No unfortunately divs are not supported (but I haven't found a list of things that are supported in the Apple documentation). This is not a web browser, Apple just allows to extract some basic styling information to create fancy strings :slight_smile:

I see, thanks for the info though, guess we have to stick to what we have now.

I would share the preset once the BTT_PRESET_FOLDER bug is fixed~