How do I prevent a script from running that opens Dialog Box when opening a particular layout, but is required for other reasons.
It sounds like you have anOnLayoutEnter script trigger.
Disable the script by going to the Layout Setup>Script Triggers and then uncheck OnLayoutEnter
Sorry I should have been a bit clearer. I need the Dialog Box to appear, but not from a particular script when a button is clicked. So I need a script step that suppresses the script that opens the Dialog Box when the button is clicked on.
Then why don’t you modify the scrip that runs when the button is clicked ?
If you share which script step is opening a dialog, we can suggest ways to modify it.
I'm not sure I fully understand what you want. Give the button a script parameter such as "block". Then in the script use an if statement to determine if the dialog should be blocked based on the script parameter.
If (get(scriptparameter) <> "block"
Show Custom Dialog
What script step(s)? And what dialog box? Screenshot(s) please?! (or more info)
Thank you, Scripts attached as requested.
It appears you have a script that trips a script trigger—in your example it appears this is an OnLayoutEnter trigger which is tripped by a layout switch within another script, thus activating the dialog. Here is one way to suppress the OLE script:
1. In the script you know may do this, just before the layout switch step add a Set Variable step to set a global variable, say $$suppress = 1
2. After that global variable has done its job, set it to $$suppress = "" so that you are not left with an active global variable any longer than needed
3. At the start of the OLE script that you want to suppress, add an exit option thus:
If [ $$suppress = 1 ]
Exit Script [ ]
run the script
This approach will mean that every time the OLE script is triggered it will look for the global variable before proceeding. If it has not been set, then the script will run as normal, but if it has been set the script will not run. Once you have set the script up this way, you can suppress it in any circumstance you need to simply by setting the $$suppress variable.
I think of this routine as being similar to Error Capture. You set the global variable just before you need it, then zap it as soon as you no longer need it, just as you should do with Error Capture—set to On just before needed, then back to Off as soon as no longer required.
You seem to forget a basic feature of a script: its capacity to get a parameter and act upon it.
Instead of blindly calling your script from various places and trying to match the script attitude to the place it comes from, just embed attitude into handling a parameter.
Which can also be "if parameter so and so, exit script" which is equivalent to your initial setup and need of finding a way to impede the script's running if so and so.
This may be a dumb question, but how do I make the $$suppress variable = 1. Is part of the Variable script. See attached.
There are no dumb questions.
Set Variable [ $$Suppress ; value: 1 ]
To destroy the variable when you no longer need it:
Set Variable [ $$Suppress ; Value; "" ]
Retrieving data ...