Using Variables in BetterTouchTool

Variables in BTT can be quite useful when using Apple Script / Java Script and the like There are three types of variables:

  • Temporary Variables - will only be available until BTT quits
  • Persistent Variables - will be persisted and be available all the time
  • Dynamic Variables - they are calculated dynamically. BTT comes with a small set of helpful dynamic variables.

Dynamic Variables provided by BTT:

  • selected_text - The currently selected text. Readonly.
  • BTTActiveWindowTitle - The title of the ative window. Readonly.
  • OutputVolume - The current output volume of the system. Readable and writable.
  • BuiltInDisplayBrightness - The brightness of the built in display. Readable and writable.
  • BTTCurrentlyPlaying - This variable returns whether the system is currently playing music/video (1 or 0). When called it also starts to observe further details and will make the following variables available:

    • BTTNowPlayingInfoArtist
    • BTTNowPlayingInfoTitle
    • BTTNowPlayingInfoAlbum
    • BTTNowPlayingInfoDuration
    • BTTNowPlayingInfoTrackNumber
  • BTTTouchBarVisible - Tells you whether the BTT custom Touch Bar is currently visible or not.

  • BTTCurrentlyPlayingApp - the app identifier of the app that is currently playing video or audio. Read only.

  • BTTInternalNightShiftState - Is the BTT night shift currently active or not? (Does not necessarily represent the system night shift state)

  • SystemDoNotDisturbState - The current state of "do not disturb". Readable & writable.

  • BluetoothConnectionState-MACADRESS-OR-NAME - Returns whether a device is connected. Can contain wildcards (kind of dynamic-dynamic variable). E.g. BluetoothConnectionState-Airpod. Radable and writable.
  • BTTActiveAppBundleIdentifier - The bundle identifier of the currently active app. Readonly.
  • BTTActiveWindowNumber - The window number of the active window (to identify a window). Readonly.
  • BTTTouchBarHasPhysicalESCKey - Is 1 if the TouchBar Macbook has a physical ESC key. Readonly.
  • BTTLastTriggeredAction - The id of the last triggered BTT action. Readonly.
  • BTTLastTriggeredUUID - The UUID of the last triggered BTT action. Readonly.
  • BTTLastTriggerTime - The timestamp when the last BTT action was triggered.

You can always see your temporary and dynamic variables in the BetterTouchTool settings: webserver

results matching ""

    No results matching ""