4 Replies Latest reply on Mar 3, 2009 10:13 AM by johnhorner

    script triggers, select/perform, select all



      script triggers, select/perform, select all


      i have a rolodex file which has a "rolodex code" text field (required, unique) and a "company name" text field.  when a new record is created a "rolodex code" must be entered before you can proceed as it is a required field.  i am trying to set up a script which trigger so that when i exit rolodex code, it will automatically go the the field "company name" and select the existing contents (which were auto-entered upon creation to simply be "Company Name".  however, i have set up the following script and it doesn't do anything:


      Go To Field [Select/perform; ROLODEX::CompanyName]


      i have also tried adding the "Select All" step to the script and it also does not work.  i tested the trigger by  substituting the desired script step/s with a setfield script step which does successfully insert text into the "company name" field.


      am i doing this wrong?  i am assuming that "select/perform" would select the contents of a field and that "select all" would also do this.  is this not a correct assumption?


      does anyone have any thoughts as to why this is not working?  any help would be much appreciated.





        • 1. Re: script triggers, select/perform, select all

          Howdy johnhorner,


          I may be oversimplifying...if so, please forgive me.


          Would you achieve what you're after by setting the Field Behavior of ROLODEX::CompanyName to "Select entire contents of field on entry" ?  In FMP8, it's under Format>Field/Control.  Not sure where it would be in FMP10.


          Is this what you are after?

          • 2. Re: script triggers, select/perform, select all

            hi ninja,


            that is essentially what i am trying to accomplish, but i would prefer that the entire contents are selected only the first time that i enter data into the field and that any subsequent modifications of hte field would not select the entire contents.


            if i just run the script itsel, it works correctly and goes to the company name field and selects the entire contents.  if i set the script trigger to execute on "modify" then it also works correctly but it then won't et me enter all of the information i want in the first field because as soon as i enter a single character it runs the script that takes me out of the original field and into the target field.


            there is something about the execute on object exit command that runs the script and then adds a step that functions as the equivalent of hitting the return or enter key or running a commit record type step because i have discovered that the script step does actually go the the field and select all of the contents but it is only for an instant an then it exits the field without any aditional input.


            does anyone know why this happens? .....help?




            john h.

            • 3. Re: script triggers, select/perform, select all

              FileMaker Script triggers White Papers -


              The OnObjectExit trigger is a “pre”-processing trigger. This means this trigger

              executes a script before the event has been processed. 


              Since the event you are dealing with is "Exit" it looks like your script gets triggered before the triggering field is really exited.  After your script finishes the OnObjectExit trigger return the focus back to the original field and processes the exit. 


              • 4. Re: script triggers, select/perform, select all

                thanks vcirilli,


                that explains why it is not working as i had expected.  you just saved me many hours of tinkering to try and figure it out.  i will have to see if i can come up with another way to accomplish the same task now...


                kind regards,


                john h.