9 Replies Latest reply on Apr 7, 2014 6:56 AM by AnthonyGiuliano

    Install OnTimer Script Questions

    CarlaS

      Title

      Install OnTimer Script Questions

      Post

      New to FM 10 - been in the dark ages of FM 5 for the last 10 years.  I'm trying to understand how the Install OnTimer Script works. 

       

      What I am trying to do is to have the Install OnTimer Script to run a script called PIF Submission at regular intervals (probably every 300 seconds).  I have created the OnTimer Script:

       

      Install OnTimer Script [ "PIF Submission" ; Interval: 300 ]

       

      I can't figure out how to make the script fire.  The Script Steps Reference Guide says:

       

      "Runs a specified script at the specified interval. Installs a single timer per window. After the specified interval has passed, the next time the application is idle, runs the specified script.  This step repeats until the window in which it is running closes or its options change. You can also halt the step by specifying another Install OnTimer Script script step for the window with no script specified."

       

       

       

      I don't understand how to make this work.  Should I put the Install OnTimer Script in the Startup Script or do I attach the script to a button or an On Layout Load script trigger?  What do they mean by "installs a single timer per window" mean?  What window are they talking about?

       

      Any advise would be appreciated.

       

      Thanks!

      Carla 

       

       

       

      BACKGROUND INFO:

       

       

      We are using Filemaker Pro 10 Advanced and Filemaker Server 10 Advanced. Filemaker Server Advanced is running on a Windows PC server. We have about 25 Filemaker client users (both Mac & PC). We also have non-Filemaker client users for employees company wide to access a couple of layouts via Custom Web Publishing. Our company has been using this Filemaker database since 1998. I personally have been using Filemaker since the late 1980’s when it was called Claris Works. We just recently upgraded from Filemaker 5 to Filemaker 10 and are in the process of a major overhaul of the entire database. Records in the main table represent individual marketing jobs (usually print jobs - i.e. brochure, forms book, mailer, etc.). Then, we have about 18 related tables for tracking various aspects of a job through the production schedule, from job initiation to completion. It tracks milestone due dates, design specs, licensing information, inventory, distribution, costs, etc.

        • 1. Re: Install OnTimer Script Questions
          mrvodka

           

          The Install OnTimer script step works on the active window of when the script was called. You can only have one script working per each window. Therefore, if you open a new window whether manually or by script, it does not affect the new window.

           

          You can cancel it by either closing the window or calling another Install OnTimer script step with either 0 duration or no script selected. If you call a different OnTimer script step for a window that already has one running, it will override the existing one.

           

          Basically, the Timer works for each window and not a specific layout or object.

           

          • 2. Re: Install OnTimer Script Questions
            CarlaS

            Thanks for your reply!

             

            So, what makes the InstallOnTimer script fire? 

             

            Could I add the script step to the startup script?  The PIF Submission script sends an email to the Project Rep selected in new records created in a table via Instant Web Publishing.  If I add the script to the startup script, would it run the script each time a user logs in and there for numerous scripts would be running at the same time?  Would this create a conflict?

             

            Thanks!

            Carla

            • 3. Re: Install OnTimer Script Questions
              mrvodka

              Install OnTimer is not IWP compatible.

              • 4. Re: Install OnTimer Script Questions
                CarlaS

                Project Initiators complete the Project Initiation Form (PIF) layout via IWP.  The Project Reps all use FileMaker Client to access the database.  The Install OnTimer would be running when the Project Rep was logged into the database via FileMaker Client.  I'm wondering if conflicts would occur having multiple Project Reps running Install OnTimer scripts simultaniously.

                 

                Also, having it as part of a startup script would cause a problem if a user opens a new window and closes the original window after startup.  Is there a way to attach a script when a new window is opened? Or, should I create an On Layout Load script trigger that would restart the Install OnTimer when the user moves between layouts?  Could this cancel any Install OnTimer scripts running in the current window or other windows when the new script is triggered On Layout Load?  Or would they be running simultaniously in each window?

                 

                Still trying to work through this.  Any recommendations would be appreciated.

                 

                Thanks!

                Carla

                • 5. Re: Install OnTimer Script Questions
                  mrvodka

                  Well if you have it triggered on layout load, then yes you may have a potential to over ride an existing one.

                   

                  Do you have advanced? If so you can use a custom menu to replace the new window command. When a new window is opened, it could call your custom script to open a new window and then run the Install OnTimer.

                  • 6. Re: Install OnTimer Script Questions
                    CarlaS

                    Just a couple more questions:

                     

                    Does starting a new Install OnTimer script automatically halt previous script?  Or, do I need to use the Halt Script as the first step in my On Layout Load script?  If I have to use the Halt Script step, does it halt all scripts running by the user or all scripts running by all users?

                     

                    I do have advanced.  I haven't used the custom menu feature yet, but this sounds like a great idea.  I'll try it out.  Thanks!

                     

                    Carla

                    • 7. Re: Install OnTimer Script Questions
                      mrvodka

                       


                      CarlaS wrote:

                      Just a couple more questions:

                       

                      Does starting a new Install OnTimer script automatically halt previous script?  Or, do I need to use the Halt Script as the first step in my On Layout Load script?  If I have to use the Halt Script step, does it halt all scripts running by the user or all scripts running by all users?

                       

                      I do have advanced.  I haven't used the custom menu feature yet, but this sounds like a great idea.  I'll try it out.  Thanks!

                       

                      Carla


                       

                       

                      No it does not. FileMaker's scripts are single threaded. One has to finish before another can start. The Halt script step stops all the scripts and subscripts within that stack but not to one that is already running independent in teh background.

                       

                       


                      • 8. Re: Install OnTimer Script Questions
                        CarlaS

                        Thanks  Mr. Vodka!

                         

                        I think that answers all of my questions.  Kudos to you for staying with me on this!

                         

                        Carla

                        • 9. Re: Install OnTimer Script Questions
                          AnthonyGiuliano
                               

                                    The Install OnTimer script step works on the active window of when the script was called. You can only have one script working per each window. Therefore, if you open a new window whether manually or by script, it does not affect the new window.  

                                

                               Sorry to revive such an old thread but it has some info related to my question. When you say the OnTimer script runs in the window that was active when the script was called.. Do you mean the active window when the script step is called? Or the active window when the script containing the "Install OnTimer" step was called.

                               Basically, if I have a script with two steps. 1) New Window, 2) Install OnTimer. Will the OnTime script run in the New window from step 1 or in the window that was active when this script was run? I have been trying to test and it seems like it's running in the Old Window rather than the New Window. Thanks

                                

                               Edit* Using Filemaker Pro 11 Advanced