AnsweredAssumed Answered

Trouble with script triggers and tab switching

Question asked by deathrobot on Aug 27, 2013
Latest reply on Aug 27, 2013 by deathrobot

Title

Trouble with script triggers and tab switching

Post

     I am having a bit of trouble with a technique of switching tabs via script from Seedcode:

     http://www.seedcode.com/filemaker-12-layout-tricks-hiding-tabs/

     There are two parts to having this work. The first part is that you set the tabs to an OnTabSwitch script trigger that calls:

          If [ isEmpty (Get (ScriptParameter ) ) ]
              Exit Script [ Result: False ]
         End If

     with a script parameter of "Get ( ScriptName )". This makes it so that the user cannot change tabs by clicking with a mouse (since there is no ScriptName). But, if a script uses Go to Object [ Object Name: the tab's object name ], the tab switch will work.

     What I'm trying to do is to switch between tabs when changing modes (e.g. from Browse to Find). I am using a layout script trigger using onModeEnter. The script called is this:

          If [ Get ( WindowMode ) = 1 ]
               Go to Object [ Object Name: "Find Tab" ]
               Exit Script []
          End If
          Go to Object [ Object Name: "Browse Tab" ]

     If I enter find mode, the script is triggered and the tab correctly switches to what I've labeled as "Find Tab". However, when I switch back to Browse mode, the "Find Tab" stays active; it does not switch back to what I've labeled as "Browse Tab". If I disable the OnTabSwitch script, changing modes works correctly. Can't see why this would be though, since the tab change is being called by a script, therby making the script parameter NOT empty. Am I missing something obvious?

     Thanks,
     Michael

Outcomes