HELP: Conditional Activation Groups with Variables


I'd like to know how to use it, as i'm a bit lost as to how it works. What is the variable name I need to make and how do I reference it's contents?

The variable name is "customVariable1". You can set it using the default Apple Script functions for setting variables in BTT :slight_smile:


tell application "BetterTouchTool" to set_string_variable "customVariable1" to "test"
1 Like

wow okay, it was that simple huh?

Honestly I think it should be a bit clearer..

The best thing would be to rename the variable to something like “Conditional Activation Variable 1” but I guess it will mess up other people’s setups.

Maybe put it in quotes, like
BTTVariable: “customVariable1”

@Andreas_Hegenberg Is there a way to stably update the custom macOS Control Strip icon using this?


  • I'm using this to drive some of my safari widgets. Some websites don't put their name in the windowname thus an applescript is required to drive the change in conditional activation group.

  • Each Safari Widget set also has a custom control strip icon, which shows if the website is active.

  • The BTT bar is usually closed so that the user can use the native Safari Touchbar, with the option to occaisonally open BTT for the web-specific options.

Right now I have a widget thats always on and updating as long as safari is active. It is working as best as it can and is successfully switching the conditional activation groups, however, it can only do this if the user opens up the BTT bar.

Basically, is there a way to always run the script even if not showing? Because I need that custom control strip icon to change instantly and automatically as there are web-specific actions attatched to it

In addition, If the conditional activation groups switch based on the variable (one goes inactive and one gets active), and if they are both set to Hide BTT bar, Show CS if Opened, the BTT bar alway closes after it switches instead of staying up which is not desirable.

  • 1 is active, BTT bar is open showing 1
  • The variable updater changes the customVariable
  • 1deactivates, 2 activates. It is set to Hide BTT bar, Show MacOS CS on open
  • the BTT bar closes. MacOS bar visible. (undesirable since user did not close the bar)

This is currently not possible. BTT widgets only run their scripts when they are visible.

I will be adding a time based trigger (like cron job) in one of the upcoming versions though, which would allow this.

Most performant solution would be a plugin that adds the domain to the title. For Google
Chrome I'm using this:
For Firefox there are also multiple, e.g.
But I'm not sure if there is a similar one for Safari.

1 Like