Set BTT value to a custom variable

I want to assign the value of "active_app_name" to a custom variable. I have tried {active_app_name} in the text, but it's not working.

Is it possible to do it with this action, or do I have to use an applescript action?

This is the screenshot of what I've tried:

1 Like

Hi @jordikt,

I was able to assign the value of the active_app_name Advanced Trigger Condition Variable to a custom variable by following these steps:

  1. Under Automations & Named & Other Triggers, create a Active App Did Change Trigger.

  2. Create a Run Apple Script (async in background) Action assigned to the Trigger.

  3. Add this AppleScript code to the Action:

     tell application "BetterTouchTool"
         set the_name_of_the_active_app to get_string_variable "active_app_name"
         set_persistent_string_variable "AWDC_ActiveAppName" to the_name_of_the_active_app
     end tell
    

Thanks for the script @fortred2 !!

Anyway, I would like to use the "Assign/Set Value for Variable" action. Let's see what @Andreas_Hegenberg says…

that action can currently only set static values, but allowing variables there is a good idea

1 Like

It would also great to allowing variables in "Advanced Conditions" and "If Condition" action.

I mean to allow this:

3 Likes