7 Replies Latest reply on Jul 26, 2011 2:14 PM by Bilic

    Script help

    Bilic

      Title

      Script help

      Post

      I'm trying to perform the following via a script but can't figure it out.......

      1) copy the contents of field A

      2) move to a different layout and within that layout enter find mode and find the following in a certain field: "= field A contents" (that was copied from the other layout.)  I need to insert the equals sign because it has to be an exact match.

      Basically, one layout has a field where the value is numeric and I'm trying to do a find in a different layout looking for that number.

      Any help would be greatly appreciated.  Thanks.

        • 1. Re: Script help
          c.wagner1

          excuse my sysntax here, the script syntax wont be exactly right, but you will get the point.

          Set Variable [$searchFor, "=" & table1::field A]

          goto layout ["the other layout"]

          enter find mode

          set field [table2::field B,  $searchFor]

          perform find

          Chris

          • 2. Re: Script help
            philmodjunk

            For "exact match" you may want to use == instead of =.

            • 3. Re: Script help
              Bilic

              When I do the "perform find" it wants me to enter a criteria and it's that criteria I don't know what to put it.  I want to tell it to paste or copy the info from the other field I copied (field 1) and put it into the new field (field 2).

              • 4. Re: Script help
                philmodjunk

                Here's a more detailed script listing with comments on certain scripts added after //

                Set Variable [$searchFor, value: "=" & table1::field A]
                go to layout ["the other layout"]
                enter find mode[] //clear the pause check box
                set field [table2::field B,  $searchFor]
                Set Error Capture [on] //keeps no records found dialog from interrupting your script if no records match your criteria
                perform find[] //do not specify any criteria in this step, the set field step has already specified the criteria you need

                • 5. Re: Script help
                  Bilic

                  Hmmm. It's just switching layouts without performing the find.  Perhaps I'm not understanding "$searchFor".  I'm litterally typing in that text where you indicate it.  The set field in mine reads slightly different than yours.  It reads:

                  Set Field [table2::field B[$searchFor]]

                  This is exactly how my script reads:

                  Set Variable [$searchFor; Value:"=" & Shot Info::_pkShotID

                  Go to Layout ["PLATE DATE" (elements)]

                  Enter Find Mode []

                  Set Field [Elements::_fkShotID[$searchFor]]

                  Set Error Capture [On]

                  Perform Find []

                  And when I run this, it just changes layouts without performing any find.

                  • 6. Re: Script help
                    philmodjunk

                    The extra brackets tell me that you don't have the set field step set up correctly.

                    When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Click OK. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.

                    • 7. Re: Script help
                      Bilic

                      You're a genious!  Thanks soooooooo much.  Works like a charm.  Very helpful and very much appreciated :)