7 Replies Latest reply on Jun 10, 2010 7:28 AM by mrvodka

    Disable find mode

    BatMan

      Title

      Disable find mode

      Post

      Hi folks

       

      I'm creating a runtime app with FM Pro 11 Advanced on MAC OS X 10.6.

       

      Is there a way to block/disable find mode under certain conditions, like being on a certain layout, or by explicitly telling FM? I would like to prevent the user from manually entering find mode while an AppleScript is doing some stuff, because those operations may fail when not done in browse mode. I could enter browse mode every time the AppleScript tells FM something (is there an AS event for that?), but that's an ugly workaround.

       

      Ideally, the "Find" icon on the status toolbar would be grayed out also.

        • 1. Re: Disable find mode
          Mystick

          you could use a custom menu...  then you can relate the find mode option to a script where you decide when to enable it

          • 2. Re: Disable find mode
            BatMan

            Thank you for replying! Could you please be a bit more specific? Do you suggest to link the execution of the AppleScript to a custom menu item, which would only be enabled in browse mode? If so, then this is not exactly what I'm looking for, because the user could still enter browse mode after the script has been launched, i.e. during execution.

            • 3. Re: Disable find mode
              Mystick

              In a custom menu, you could relate the Go to find mode menu item to a script.

              inside this script you could say that if the current layout is A or B or D you do "Find mode" And if current layout is C you do nothing.

              then if the user is on layout C and try to go in Find mode, nothing will happen.

               

              ANOTHER WAY...

               

              you could create a script with only instruction go in Browse mode.

              in your Layout, in the layout triggers, OnEnterMode, check only the box for Find mode and attach the script there.

               

              If the user try to go to find mode, it will switch him back to browse mode.

               

               

              • 4. Re: Disable find mode
                BatMan

                Great suggestions, thank you! This is very close to what I want. The users might still trick both ways though, by first going to another layout and then entering find mode, which he would be allowed in both cases. But they'd really have to want to fool the app bad if they went that far. I think I'll implement your first solution.

                • 5. Re: Disable find mode
                  mrvodka

                  Why not just use an OnExitMode script trigger ( enable in browse mode only checked ) that calls a simple script:

                   

                  If [ Get ( AccountPrivilegeSetName ) <> "[Full Access]" ]

                  Exit Script [ 0 ]

                  End If

                   

                   

                  I would also add a OnLayoutEnter trigger ( enable in find and preview modes ) that would call something like:

                   

                  If [ Get ( AccountPrivilegeSetName ) <> "[Full Access]" ]

                  Enter Browse Mode [ ]

                  End If

                   

                   

                  This will ensure that if a user goes to find mode in another layout then goes to that layout, it will go to browse mode.

                   

                   

                   

                  P.S. The Full Access check it to allow a developer with Full Access to bypass this.

                   

                   

                  Edit - Added P.S.

                  • 6. Re: Disable find mode
                    BatMan

                    What does your first script do, mr_vodka? Either exit and do nothing, or do nothing and exit? I don't get that one.

                    • 7. Re: Disable find mode
                      mrvodka

                      OnObjectExit is a preprocess trigger. You can stop the action from happening by using an Exit Script [ 0 or Flase ]

                       

                      Therefore it stops it from going into another mode.