If this works for your solution, why not hide the tab labels altogether, being you need one tab on browse and a different tab for find, and don't want the user to be able to switch them? Then you could use OnModeEnter or OnModeExit triggers to control the tabs. Maybe you could use those with your existing scripts to get it to do what you need it to do.
Thanks Steve. I am actually already hiding the tabs using conditional formatting [ ( Formula: Get ( WindowMode ) ≠ 4 ) set font size to 500 ]. The purpose of the SeedCode script is to prevent the user from clicking on the tabs, but when you're in Layout mode, you can see the tab and tab names; makes it nicer to deal with when editing the layout. And, the script is working for me with OnModeEnter, but only going from Browse Mode to Find Mode, not the other way around. I've checked my labels numerous times and they seem to be correct, so I can't figure out why it's not working when going from Find to Browse.
I suggest the following changes:
If [Not $$ModeChange ]
Exit Script [ Result: False ]
Set Variable [$$ModeChange ; Value: True ]
If [ Get ( WindowMode ) = 1 ]
Go to Object [ Object Name: "Find Tab" ]
Go to Object [ Object Name: "Browse Tab" ]
Set Variable [$$ModeChange ; Value : False ]
Your script structure is a little wonky, but the simplest solution is to put an Exit Script at the end of your script.
Because on the Go to Object for Browse, the script is done and nothing gets passed to the Tab Switch Trigger script. With an Exit Script, that script is still live after to Go to Object.
Thanks Phil and David. I first tried your solution, David, since it was easier, but it didn't work for me. Not sure why; it made complete sense. Then tried your solution, Phil. This did solve it. Thanks to you both.