2 Replies Latest reply on Jan 26, 2011 1:44 PM by GertvanOss

    Find request via AppleScript

    GertvanOss

      Title

      Find request via AppleScript

      Post

      While using FMPro Advanced 11 I'm running into a problem as I try to do a find request via AppleScript. 

      Can someone tell me what I'm doing wrong?

      Thanks,

      Gert

      tellapplication "FileMaker Pro Advanced"

      telldatabase "adressenboek_3.fp7"

      telltable "addressenboek"

      try

      delete every request

      endtry

      create request

      setfield "firstname" ofrequest 1 to "Piet"

      find

      endtell

      endtell

      endtell


      error "FileMaker Pro Advanced got an error: Object not found." number -10006 fromfield "firstname" ofrequest 1 oftable "addressenboek" ofdatabase "adressenboek_3.fp7" to «class Piet»

        • 1. Re: Find request via AppleScript

          Gert van Oss:

          Thanks for posting!

          I think the issue is that it was attempting to run the find request on the wrong table. Using "go to layout" instead of "tell table" resolves this.

          tell application "FileMaker Pro Advanced"

          tell database "DatabaseName"

          try 

          go to layout "LayoutName"

          end try

          delete every request

          set request1 to create new request

          tell request1

          set field "FieldName" of request1 to "Data you'd like to search for"

          end tell

          find

          end tell

          end tell

          Let me know if you'd like any clarification on the above.

          TSBear

          FileMaker, Inc.

          • 2. Re: Find request via AppleScript
            GertvanOss

            okay, great, that works perfect.

            I was close when I once earlier today I tried something like "show layout ...".

            My research paid off anyhow and with this answer it's been a successful journey. 

            Thanks,

            Gert