Select the Tab control while in layout mode and set it up with the OnTabSwitch script trigger. Use this trigger to perform your script that uses the two get functions to do what you want here.
Say you have two tab panels with object names (Created in the name box in the inspector), of "First" and "second".
If you, or a script changes the focus from "First" to "second", bringing the second panel to the front,
Get(TriggerCurrentTabPanel) will return "First"
Get(TriggerTargetTabPanel) will return "second".
Thus, you can set up If script steps in the script that use these two functions to determine what tab was current before the focus changed and what tab will become current if the script allows the tab switch to proceed. (To keep the tab switch from happening, use Exit Script [false].
It seems straight forward but something seems to be broke on my end. Here's a screen shot of my Dataviewer with 2 simple tabs and switching between them. They are named "A" and "B". The Dataviewer shows that the two "Get" functions for the Tab Panel Script trigger do not return the second value which is supposed to be the Tab Name.
I've tried and tried but cannot get this to work on several different machines. Any Ideas? Anyone?
FIlemaker Pro 12 Advanced
MacOS X 10.8