7 Replies Latest reply on Dec 10, 2008 3:08 PM by XRayKing

    Using a pop-up List to select a script comand

    XRayKing

      Title

      Using a pop-up List to select a script comand

      Post

      I'm trying to use a button to call up a pop-up list field and then use the results of the user selection to perform another script function. 

       

      The script below works well on a MAC platform (OS X) but on Windows (XP Pro) we experience a delay to pull up the Value List used and the value selected doesn't get selected.  Any ideas why this is or any better ideas for a script to perform the same function?

       

      <!--   StartFragment   -->

      Set Field [Field Service Reports:: Print Selection Button;”PRINT”]

       

      Clear [Select; Field Service Reports :: Print SelectionField]

       

      If [Field Service Reports::Print selection field = "PrintSelection" or IsEmpty(Field        Service Reports::Printselection field)

       

              Goto Field [Field Service Reports :: Print Selection Field]

       

      Loop

       

      If [Field Service Reports::Print selectionfield = "Print Selection" or IsEmpty(Field Service Reports::Printselection field]

       

      Go to Field [Select/perform;FieldService Reports :: Print Selection Field]

       

                    Pause/ResumeScript [Duration (seconds): Time(0;0;4)]

       

               Goto Field [Select/perform;Field Service Reports :: Print Selection Field]

       

      Exit Loop If [Field ServiceReports::Print selection field     "PrintSelection"   and     Field ServiceReports::Print selection field  ≠""]

       

      Go to Field[Field Service Reports :: Print Selection Field]

       

      End If

       

      End Loop

       

      If [Field Service Reports::Print selection field ="Invoice"]

       

                  PerformScript [Print Invoice]

       

      End If

       

      If [Field Service Reports::Print selection field = "Field ServiceReport"]

       

      Perform Script [Print Field ServiceReport]

       

      End If 

       

      Thanks 

        • 1. Re: Using a pop-up List to select a script comand
          TSGal

          XRayKing:

           

          Thank you for your post.

           

          I'm having a little difficulty understanding what is happening.

           

          Is there an "End If" before the "Loop"?

           

          Inside the "Loop", if either "Print selection field" does not equal "PrintSelection" or not empty, you're in an endless loop.

           

          Any additional information you can give me would be helpful.

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: Using a pop-up List to select a script comand
            XRayKing
              

            No there is not a "End If" before the "Loop"

             

            That is correct the "loop" continues until a valid name is selected from the "Pop-List"

             

            Thank You for Your reply

            • 3. Re: Using a pop-up List to select a script comand
              XRayKing
                

              Some additional info

               

              The purpose is for the user to chick on the "Print Button" and that would bring up a "Pop-Up Menu" field and enter a "Loop" which with in is has a delay for 3 sec. in which to allow the user to select a name from the "list".  After the delay the Script sees a name selected and exits the "Loop" then performing a function depending on what name was selected.

               

              Thank You Again 

              • 4. Re: Using a pop-up List to select a script comand
                TSGal

                XRayKing:

                 

                Even though there are only three "End If" to four "If" statements, I think I understand what you are trying to do.

                 

                It's the end of the day for me here, so I'll have to try tomorrow.  Hopefully, someone else will jump in with an answer.

                 

                TSGal

                FileMaker, Inc. 

                 

                 

                • 5. Re: Using a pop-up List to select a script comand
                  XRayKing
                    

                  I'm sorry.  Your right there is another "End If" right after the "End Loop"

                   

                  I really Thank You for any help 

                  • 6. Re: Using a pop-up List to select a script comand
                    TSGal

                    XRayKing:

                     

                    Thanks for the clarification.

                     

                    I think the script can be reduced in size.  Look over the following, and let me know if this works.

                     

                    ----------------- 

                     

                    Set Field [Field Service Reports:: Priint Selection Button; "PRINT" ]

                    Clear [Select; Field Service Reports:: Print Selection Field ]

                     

                    Loop

                     

                       Exit Loop If [Field Service Reports:: Print selection field ≠ "PrintSelection" and not IsEmpty [Field Service Reports:: Print selection field) ]

                     

                       Go to Field [Field Service Reports:: Print Selection Field ]

                       Pause/Resume Script [Duration (seconds); Time (0; 0; 4) ]

                     

                    End Loop

                     

                    If [Field Service Reports:: Print selection field = "Invoice" ]

                       Perform Script [Print Invoice]

                    Else If [Field Service Reports:: Print selection field = "Field Service Report" ]

                       Perform Script [Print Field ServiceReport]

                    End If 

                     

                    ------------------

                     

                    You don't need to check for the value.  Just enter the loop and check to see if the criteria is met.  If not, then you exit the loop.

                     

                    Let me know if you still run into the same problem.

                     

                    TSGal

                    FileMaker, Inc. 

                    • 7. Re: Using a pop-up List to select a script comand
                      XRayKing
                        

                      TS Gail

                       

                      Thank You very much that does work.

                       

                      One other problem I did find was if the button was hit more then once the loop would start and run as many time as you had hit it.  This was solved by Halting and exiting the script in the end of one of conditional sets.

                       

                      e.g. 

                      f [Field Service Reports:: Print selection field = "Invoice" ]

                         Perform Script [Print Invoice]

                      Else If [Field Service Reports:: Print selection field = "Field Service Report" ]

                         Perform Script [Print Field ServiceReport]

                      End If 

                      Halt Script

                      Exit Script

                       

                      Thank You Again