0 Replies Latest reply on Apr 29, 2010 9:49 AM by scjensen_1

    Order of records accessed via Applescript

    scjensen_1

      Title

      Order of records accessed via Applescript

      Post

      I have a simple (I hope) Filemaker question. I have a script that I run from Filemaker that walks through each found record in the database and takes an action (in my case, generates a Powerpoint slide). Works great, except the sort order seems totally out of my control. The script looks like this:

      tell application "FileMaker Pro Advanced"
      tell database "FMProDatabaseName"
      set theRecordCount to count records
      end tell
      end tell
      
      repeat with recNum from 1 to theRecordCount
      
      -- Grab data from filemaker
      tell application "FileMaker Pro Advanced"
      tell database "FMProDatabaseName"
      go to layout "FMProLayoutName"
      tell record recNum
      -- grab record data
      end tell
      end tell
      end tell
      end repeat

       


      I make sure I go to that layout and sort before i run the script, but I get a totally different order. What gives?

      Thanks!