Trigger script when entering perform mode

Hello,
I’m trying to understand the methods for triggering scripts. In this example, I try to trigger a script whenever I enter Perform mode.

In the Window perform there is a value called “performance” (see screenshot), which changes from 0 to 1 when entering Perform mode. So when 0 changes to 1, I want to trigger my script.

I set up a Panel Execute with Panels reference to ‘perform’ and panelvalue ‘performance’ and I put a test script in def onValueChange. But this does not work.

What would be the correct way of doing this?
I’m a beginner, so still trying to figure things out.
I also found the same question here:

But based on the answer, I could not implement it.
Thank you for your help!

Hi,

You want to check when a parameter has been triggered. Therefore, the correct node to use is the Parameter Execute DAT. You can specify there which parameters to monitor and what type of parameter is it. Here an example that runs a script when pressing the “Open as perform window” button

Best,
Darien

ScriptOnPerform.tox (8.6 KB)

Hi Darien,

thank you so much for your help and your explanation.

I set up a Parameter Execute DAT in my root folder to work with the main Window perform.

The script triggers when I press the “Open as perform window”. But It will not trigger when I use the shortcut “F1” to enter perform mode. Is there a way to trigger the script, no matter how we enter perform mode?

Hi there,

No worries! Sure, I extended a bit the example from before, so that both F1 and pressing the button will run a script. See attached.

Best,
Darien

ScriptOnPerform.tox (17.2 KB)

Thank you Darien, this does the trick.
It was interesting for me to learn, that both ways of entering perform mode had to be treated separately with 2 separate solutions.

Hello,
I use another method working with both way.
– perform chop with perform output
– logic chop
– chop execute with your script


performScript.toe (3.8 KB)

Thank you Jacques, I will take a look.

Hey @mo_mo_mo,

You should mark @jacqueshoepffner reply as the solution, since it handles both cases at once in the easiest way possible :wink:

Best,
Darien

Just wondering why the logicChop and not just the chopExecute with the onValueChange execute?

@alphamoonbase
For one point you are right, Logic chop is not necessary but onValueChange not good, onOffToOn and onOnToOff more appropriate.