Facility Control

 View Only
  • 1.  Toggle button

    Posted 08-06-2017 21:39
    Feel like I'm kinda spamming the forums these days, but qhen working with this, the questions keep comming!

    So, I have a way of triggering things through AppleScript through Dashboard, wich to me is priceless.
    Now, I'm looking at the toggle buttons. I want to basically run one command when it's pressed. And then another command when it's released again.

    I'm trying to wrap my head around it through the visual editor, but I'm stuck I think...

    Could anyone give me a working example of how you would do this?


  • 2.  RE: Toggle button

    Posted 08-07-2017 09:02

    Update: I assume there is a way to get "state" of the toggle button.
    So basically something along the following:

    var state = this.buttonState;

    if (state == 1)
    { do stuff; }
    else
    { do other stuff; }

    Though I do not know how to get this "state".


    #DashBoard


  • 3.  RE: Toggle button

    Posted 08-07-2017 11:52
    Aaaaand more spam...

    I figured out there are two ways to set up a toggle button.

    • One is just to set up a button and choose the toggle style/option when creating the button.
    • The other is to use the parameter version (wich in this case works like a charm).
    Create the button through the use of a parameter and it works just fine with the use of "this.getValue();"
    Makes me somewhat wonder why it's possible to create a toggle button that you cannot read the state of through the normal "create button".

    #DashBoard


  • 4.  RE: Toggle button

    Posted 08-08-2017 13:05
    You are absolutely correct. When you care about the state of the toggle, a parameter is by far the easiest way to get the current value.

    Thank you for posting your solution back to the group.

    James
    #DashBoard


  • 5.  RE: Toggle button

    Posted 08-08-2017 13:57
    You are absolutely correct. When you care about the state of the toggle, a parameter is by far the easiest way to get the current value.

    Thank you for posting your solution back to the group.

    James



    No worries! You also dont have to come back to me with an answer then, so saves you time as well! :)
    Now, in what case would you not care about the state of a toggle button? Isnt that kinda the point?
    #DashBoard


  • 6.  RE: Toggle button

    Posted 07-22-2018 17:24

    I found that the standard "toggle" button is great if you want to just resume (re-take) an object inside xpr sequencer. Otherwise, parameter is the way to go. And for newbies like me who spent hours trying to find out how using the new Visual method, here's a couple screenshots to help.

    1. Create a parameter with 2 values (0 , 1)
    2. Create your parameter button, select the widget hint (example: Toggle Button 13)
    3. Visual.. pick parameter, condition and xpr take id.


    #DashBoard