3 Replies Latest reply on May 6, 2010 10:59 AM by flamecoder

    Find Request

    flamecoder

      Title

      Find Request

      Post

      I would like to preform a find from AppleScript. To use the do script command, I'm putting what I need to find into a global variable field then doing a Perform Find. However my variable is not reconized in the Perform Find step. I click the Specify button in Perform Find, click New, select field for search, add == operator, then type $Insignia.

      Set Variable [$VariableName; Value:LayoutName::GlobalField]
      Perform Find [ Restore]


      I have also tried doing a find request using just AppleScript and this will result in a find but if I change the "SomeString" to another value and run it again I get the last found item and the current found.


      tell application "FileMaker Pro"
      tell database "NameOfDataBase"
      show every record
      delete every request
      set MyRequest to create new request
      set cell "NameOfField" of MyRequest to "SomeString"
      go to (find)
      end tell
      end tell


      Can anyone get me going in the right direction please???
      Thanks





        • 1. Re: Find Request
          ninja

          Howdy,

           


          FlameCoder wrote:

          Set Variable [$VariableName; Value:LayoutName::GlobalField]
          Perform Find [ Restore]


          Try:

          SetVariable [$Name; Value: TableName::GlobalField]

          Enter Find mode

          SetField[YourField; $Name]

          PerformFind[ ]

           

          Also, since it's a global field, you don't need the variable:

           

          Enter Find mode

          SetField[YourField; TableName::GlobalField]

          PerformFind[ ]

           

          I can't help with the Applescript part...

           


          • 2. Re: Find Request
            flamecoder

            Hi Ninja,

            Since this is going to be AppleScript driven, I wont have any user interaction with the interface. How would I get the FileMaker script to not pause when entering find mode?

             

            Thanks,

             

            Steven

            • 3. Re: Find Request
              flamecoder

              I found the pause button and unchecked it.