This tip demonstrates how to trigger a script execution on tab change event in FileMaker.
Set Variable [$isProjectsInFrontTab ; GetLayoutObjectAttribute ( "projects"; "isFrontTabPanel" )] Set Variable [$isEventsInFrontTab ; GetLayoutObjectAttribute ( "events"; "isFrontTabPanel" )] //here "projects" and "events" is your layout tab-object names and "isFrontTabPanel" is pre-defined command If [$isProjectsInFrontTab = 1] //condition you want to run when "projects" tab is on. Else If [$isEventsInFrontTab = 1] // condition you want to run when "events" tab is on. End If