Set toggle to false after running stuff

I’m using “False Start Toggle” so i don’t run something accidentially.

when I toggle it, after the solution ends I popup a window that says “sucessful ran script”… then I want to reset the toggle to false for the next run.

I’m not using a button because it crashes randomly with no regard for the law.

is this possible?

i wish there was some meta-scripting capability so i do stuff like “set the state of component X to off”

I tried using metahopper but it doesn’t recognize this component, or even the default toggle component as far as I can tell.

You will have to write some custom script to do so.
Here Something like this:

if (on)
    {
      myString = "Toggle was press was success!";
      //This is the section of the Code which Automatically turns off the Toggle
      var toggle = Component.Params.Input[0].Sources[0];
      ((GH_BooleanToggle) toggle).Value = false;
      toggle.ExpireSolution(true);

    }

    A = myString;

  }

  // <Custom additional code> 
  string myString = null;

  // </Custom additional code> 

ToggleOff Command.gh (4.1 KB)

cool. is there a way to get the toggle attached to a different component (upstream from the final check)?

I Haven’t had a chance to look at this. But I guess you can do it. You will have to create a component listener function at the 3rd component where the toggle has to turn off after running the solution. I’ll see if I can put up a small setup.