5 Replies Latest reply on Apr 25, 2013 11:16 AM by schamblee

    Script is not working on Mac machine.

    johan.susanto@tts.edu.sg

      Title

      Script is not working on Mac machine.

      Post

           Hi,

           I am wondering anyone can help me on this. I added a simple script to a next button to validate First name, and last name

           to be filled before user can move to the next layout.

           Got few feedback from user who were on Mac machine that they are unable to move to the next layout, despite they have filled in those fields, the have their screen frozen and keep refreshing. 

           Most PC users are not having problem with this script running fine on their machine.

           I wonder if FM scripting depends on Java script to be enabled? If yes, does Mac machine has their Java script blocked for some reasons?

           Any opinion is highly appreciated.

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

           Set Variable [$$ValidationMessage;Value:""]
           If [tblApplicant:txtName=""]
             Set Variable [$$ValidationMessage;Value:$$ValidationMessage & "First Name" & ", "]
           End If
           If [tblApplicant:txtLastName=""]
             Set Variable [$$ValidationMessage;Value:$$ValidationMessage & "Last Name" & ", "]
           If [$$ValidationMessage = ≠ ""]
             Go to Layout ["Userdetails-p1(tblApplicant)"]
             Set Field [tblApplicant:txtErrorMessage;$$ValidationMessage & " must be filled!"]
           Else
             Go to Layout ["UserDetails-p2"(tblApplicant)]
           End If

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

        • 1. Re: Script is not working on Mac machine.
          JimMac

          If [$$ValidationMessage =""]  is not normal coding and I don't understand it.  I am guessing you are checking to see if you message is "empty" to tell if there was an error.

          If so , remove the ≠ sign.

          Check out the logical funtion too....  IsEmpty ( field )  or perhaps a single line logic

          If [ tblApplicant:txtName=""  OR  tblApplicant:txtLastName=""]

          Set Field [tblApplicant:txtErrorMessage; "Both First Name and Last Name must be filled!"}

          Else..........

          Jim...

          PS:  If there continues to be a Mac/Window issue please respond back with FMP and MacOS versions.

          • 2. Re: Script is not working on Mac machine.
            johan.susanto@tts.edu.sg

                 Hi Jim,

                 Thanks for your reply and help. It was a typo. It is only  $$ValidationMessage "" on my script

            I have to set variable to fill in the $$ValidationMessage, because I am checking many more fields, and passing back which fields are left blank by users.

            User who has problem is using Mac OS X Version 10.7.5 with Java plugin 1.6 version.

                  

            • 3. Re: Script is not working on Mac machine.
              schamblee

                   I had problems with your script on pc and mac both failed.  I cleared up the problem by changing the if statements with IsEmpty() as Jim stated above.
                   If[IsEmpty(tblApplicant::txtName)]

                   I tested on Windows 7 PC and Mac OS X Version 10.7.5. 

                   You can test each step by displaying the $$ValidationMessage in a custom dialog box after each if statement. 

              • 4. Re: Script is not working on Mac machine.
                JimMac

                     I couldn't get his coding to FAIL on MacOS 10.7.5 and FMP 11v4.  I was about to try FMP12 when I read your Post, S Chamblee.  Is this a FMP12 reported error?

                     But...

                     I did get a unexpected problem by using $$Type  variable versus a Database defined Global.  I  used Speak function on Mac had "XXX" spoken for some reason inserted in $$Type variable.surprise

                     So that wild "XXX" insertions is causing the failure.

                     Jim...

                • 5. Re: Script is not working on Mac machine.
                  schamblee

                       I'm using fmp 12 advance.  I tested the script on a different pc and the script ran fine.  I will see if i can repeat the problem and let you know if I can.