November 6, 201312 yr // If [ $$SCRIPT_TRIGGER = "Off" ] // Set Variable [ $$SCRIPT_TRIGGER; Value:"On" ] // Exit Script [ ] // End If The above is code from a starter solution, can someone help me figure out what exactly it's supposed to do?
November 6, 201312 yr Solution Say you have a layout that has a script trigger on layout load. You have a button on that layout to run a script. The script pops up a new window, then goes to another layout and does some other stuff. When the script pops up the new window, we don't want the layout's triggered script to run. But there's no way for our button's script to stop the layout's triggered script from running. So we put the steps you posted above in the triggered script as an "escape hatch." Our button's script sets the $$Script_trigger variable to "off" before it does something that might cause an unwanted trigger to run (like the new window script step). My typical method is $$TriggersOFF which I would set to 1 in the button's script. In the triggered script I check for If(TriggersOFF) which is very readable to my eyes. I've experimented with clearing the $$ variable in the triggered script as in your code above. However, I prefer to do that in the same script that set it.
November 8, 201312 yr Author Thanks Mr. Fitch. Upon my second reading of your post, I got it. Although I won't "have" it until I implement it. Thanks.
November 9, 201312 yr Bottom line: any script that's triggered by "layout," "window" or "tab" should probably have an escape hatch at the top.
Create an account or sign in to comment