3 Replies Latest reply on Jan 18, 2014 10:12 PM by NicholasFernandez

    Script Trigger for Find Mode

    NicholasFernandez

      Title

      Script Trigger for Find Mode

      Post

           Is there any way to limit a OnModeEnter script trigger from firing if Filemaker is in the middle of a script? I have an OnModeEnter for Find Mode, but it needs to perform finds in the script to return the layout the way I want.

           Thanks in advance for any help!

        • 1. Re: Script Trigger for Find Mode
          GuyStevens

               You could create a layout (maybe even a simple table view) based on the layout you need to perform your find in. Then let your script go to that new layout and perform the find.

               This new layout won't have any script triggers.

               Then at the end return back to your original layout that's based on the same table and you will still have your found set.

               If you don't want to see your screen flicker then simply add a "Freeze Window" script step above the "Go To Layout" script step.

               I always make table view layouts exactly for this purpose. 

               And then I use pretty layouts with a theme for a users data entry with script triggers on the layouts.

          • 2. Re: Script Trigger for Find Mode
            philmodjunk
                 

                      Is there any way to limit a OnModeEnter script trigger from firing if Filemaker is in the middle of a script?

                 But even a layout change can trip a number of different script triggers so changing layouts doesn't always work. I use this method most of the time:

                 In every script that is performed by a script trigger, I enclose the code in the same exact if Block:

                 If [ Not $$TriggersOff ]
                   Rest of script goes here
                 End IF

                 Then, If I have a script that I don't want to trip any triggers, I use:
                 Set Variable [ $$TriggersOff ; Value: True ]

                 at the beginning of the script and

                 Set Variable [ $$TriggersOff ; Value: False ]

                 At the end of the script and just before any Exit Script or Halt Script steps in it. Care must be taken that none of your scripts leave the variable set to True or all trigger performed scripts will be disabled until a script changes the value back to False.

            • 3. Re: Script Trigger for Find Mode
              NicholasFernandez

                   thanks to both of you. I had been trying the alternate layout approach, but what I really needed was the triggerOff variable.

                   Thanks!