Script triggers are your best friend and worst enemy. They are great when they trigger as required but not always so good when you don’t want the scripts to run.
For example when opening a new window, if you are on a layout with ‘on layout load’ or ‘on record load’ these scripts will run. This can be unhelpful if all you want to do is go to another layout set some fields and close the window.
Here are two ways to avoid the pain.
You can stop using the New Window command and replace it with Goto Related Records. Create a relationship based on the primary key, Goto Related records with ‘match all in found set’ checked going to a layout without any triggers.
Have a $$Variable which is checked at the start of the scripts to be triggered.
If ( $$Variable = “Exit”)
Exit Script (true)
On the script which is opening the new window set $$Variable to “Exit” at the start and blank at the end and the scripts will be triggered but instantly finish.
The only down side to Option one is more relationships
The only down side to Option two is you have to Set $$Variable to blank at each point the running script could exit.