2 Replies Latest reply on Oct 11, 2012 2:14 PM by TurtleKoala

    Best practice to pause script until user completes action

    wladdy

      Title

      Best practice to pause script until user completes action

      Post

           From any layout, I want the user to be able to press a button, enter/modify data on Layout 2 and automatically return to original layout when done.

           What is the best practice to give the user the time to do what he needs?

           My solution is to add to Layout 2 a button setting global field Finished to Yes. The script looks something like this.

           Go to Layout 2
           Loop
                  Pause script for 1s
                  Exit loop if Finished = Yes
           End Loop
           Set Finished = No
           Go to original layout

           It works well enough, but the Pause for 1s step is very clumsy. I am sure that I am missing an obviously better way. Should I save the name of the original layout in a global variable and use it in another script to return from Layout 2? This seems inelegant as well. Any suggestion would be much appreciated. W.

        • 1. Re: Best practice to pause script until user completes action
          philmodjunk

               You can pause the script indefinitely and then the user can take as long as they need, clicking continue to continue the script.A continue button appears in the tool bar area and you can also add your own continue button if you don't want tool bars to be visible.

               You can simply record the current layout name or number in a global field or variable and simply end the script after bringing up the layout. A button on Layout 2 can use the layout name or number saved in this manner to return the user.

               You can use  new window to open a new window and take the user to layout 2. When the user is finished, they close the window to return.

          • 2. Re: Best practice to pause script until user completes action
            TurtleKoala

                 You can set your pause script step to "Indefinite." Then, when you set up your button, set the control to "Resume Script."