OnTabSwitch
Triggers a script to run when a tab control changes panels. This can happen, for example, when the focus in a tab control moves to a different panel or when a user clicks an inactive tab in a tab control.
When the script runs
Before the event has been processed.
Modes in which the trigger can be used
Browse and Find modes.
Result
You can use the Exit Script script step within the triggered script to return True or False.
 •
 •
Originated in 
FileMaker Pro 12.0
Notes
OnTabSwitch applies to the entire tab control and not to individual panels. To control switching to particular tab panels, use the Get(TriggerCurrentTabPanel) and Get(TriggerTargetTabPanel) functions.
Related topics 
Setting up script triggers
Setting script triggers for layouts
Setting script triggers for objects