1 Reply Latest reply on Jul 27, 2013 6:49 AM by RamonRempel

    using a create new request find applescript multiple times

    RamonRempel

      Title

      using a create new request find applescript multiple times

      Post

            

            

           -- I can't figure out what I am doing wrong with this script.  It works fine when run once, but if I run it again from a different record it combines the new results with the old ones.  

           --It seems like the 'delete every request' isn't working or/and the new find is appending the results to the old found set.  Can anyone tell me what I am doing wrong?

           --it's probably something simple but it is driving me crazy (I know I could do this in other ways but this is a simplified version of a longer script so the current structure is important)

            

      tellapplication "FileMaker Pro Advanced"

            

      go tolayout "initial layout"

      setcurrentIDtocell "SID" ofcurrent recordaslist

            

      go tolayout "second layout"

      showeveryrecordoftable "two"

      telldatabase "thedatabase"

      delete every request

      repeatwithifrom 1 tolengthofcurrentID

      set theFindRequest to create new request

      telltheFindRequesttosetcell "SID" toitemiofcurrentID

      endrepeat

            

      find

      endtell

      endtell