#✅ | Making a button change variables to true or false

1 messages · Page 1 of 1 (latest)

frozen socket
#

I want to make a button change a FM Variable to true or false when clicked, how can I accomplish that?

quartz socketBOT
# frozen socket I want to make a button change a FM Variable to true or false when clicked, how ...

You can do that with a button action script:

  1. Make sure the variable exists via Customization → Variables → Manage Variables (see the Variables page).
  2. In the layout editor, right-click your button and choose Edit Action Script.
  3. Add an action: Set Variable Value (FM Variable) and enter yourVariableName:true (or :false), then save.
  4. If you want the button to toggle between true/false, wrap the actions in an IF / ELSE block that checks the current state (use Is Variable Value requirement with getvariable placeholder) and set it to the opposite value in each branch.

Let me know if you’d like a concrete toggle script example 😊

frozen socket
#

The IF / ELSE option is greyed out

quartz socketBOT
# frozen socket The IF / ELSE option is greyed out

The IF / ELSE options aren’t standalone buttons—FancyMenu wants you to add them from the action script context menu instead. While you’re inside the action script editor, right-click the big dark-grey area (not on an action entry) and choose Add → IF Statement (or ELSE/ELSE-IF). That’s also how you add actions inside those statement blocks.

If the option is still greyed out after that, let me know what exactly you clicked and what entry is selected—we can figure out what’s blocking it 😊

Reference: Action Scripts