6 Replies Latest reply on Apr 8, 2014 2:36 PM by philmodjunk

    Install OnTimer Script

    AnthonyGiuliano

      Title

      Install OnTimer Script

      Post

           I seem to be having problems getting two OnTimer scripts running simultaneously without them interfering with each other.  I'll open a new window, run a 1-step script that just Installs OnTimer Script, open a second window, then run another 1-step script installing OnTimer.  I check back in a few hours and it seems like one of them is running in the wrong window.  I can tell because one of the timer scripts has a loop where it goes to a portal row record, etc., but the other window doesn't have a portal on the layout so it gets caught in that loop once it starts running in the wrong window.

           Any ideas on how to make these OnTimer Scripts stay running in the correct window, or insight into how this works that may help me understand what the problem is?

           Thanks in advance!

        • 1. Re: Install OnTimer Script
          philmodjunk

               Sounds like the focus was on the wrong window when the install ontimer Script step was executed. You may need to add a select window step to be sure that you have the correct focus just before the Install script executes.

          • 2. Re: Install OnTimer Script
            AnthonyGiuliano

                 Thanks for the input.  My next question was how does it decide which window to use.  I had tried inserting a "New Window" script step before the "Install OnTimer" step, but it was still running from the original window.  So I figured that maybe it was using the window that was active when the script was initiated, rather than the script step, which is why I started manually opening the windows before running the script.

                 I'll play around with the Select Window step to see if I have better luck.  Thanks again.

            • 3. Re: Install OnTimer Script
              AnthonyGiuliano

                   That script step seems to have done the trick.  It's been running all day, and still appears to be running as expected.  There is still some unexpected behavior though when it comes to knowing what window the script will / should run in.  For example, even now with both scripts running as expected, if I open a new window from the Window menu (OS X), one of the scripts starts running in that new window.  I close the new window and it continues running in the proper window.  Not the biggest deal in the world but I do wish that I understood exactly how this is supposed to work.

              • 4. Re: Install OnTimer Script
                philmodjunk

                     Does your script specify the window with select window when this happens? If your script doesn't select for a window, it will perform in whatever window has currently been activated.

                • 5. Re: Install OnTimer Script
                  AnthonyGiuliano

                       The script that calls the "Install OnTimer" step specifies a window.  The script that is actually on the timer does not specify a window.

                  • 6. Re: Install OnTimer Script
                    philmodjunk

                         And thus that second script is performed in whatever window is currently active. Add a select window step to that script and I think you will no longer see this issue.