2 Replies Latest reply on Oct 12, 2009 8:23 AM by TSGal

    FM 10.0v3: AppleScript: 'whose' clauses not working correctly

    Peter123

      Summary

      FM 10.0v3: AppleScript: 'whose' clauses not working correctly

      Description of the issue

      I'm actually using FM Pro 6.04 in an automated workflow. I never considered updating since AppleScript support has been an issue with every FM update, especially 'whose' clauses.On 10.6 the 'count' command stopped working in FM 6.04 and while I could workaround that I thought I give the current FM release a try (I'm happy I did not bought it blind).I thought with four major releases they could have an opportunity to have AppleScript issues fixed, but it has become even worse. I will now workaround the 'count' command in 6.04 and hope for the next FM release.Btw, I searched, but it seems there's no other database with AppleScript support? Does anybody know one? I might have to switch to RealBasic DB, but that would require to create the entire workflow new, which I try to avoid, if possible.   (*Problem Summary:-- Mac Pro, OS 10.6.1, FM Advanced 10.0v3- 'whose cellValue of cell cellName = x' works when the query matches, but is unusable since it's incredible slow.- 'whose cell cellName = x' works much faster, but does not work if more than one database is used (errors when another database window is in front).- non-matching queries never return an empty result. Instead they always cause an error. Workaround is to use 'try-on error' for every 'whose' query, but it blows scripts up, makes them harder to read and complicates the logic.*)  -- Test Script:property MainDB : "Main" -- 20000 records ~200 MB in sizeproperty DummyDB : "Dummy" -- just any other DB, content doesn't matterproperty cellName : "Street" tell application "FileMaker Pro Advanced"   -- Queries matching the last record in the MainDB:--set RecID to ID of record 1 of database MainDB whose cell cellName = "Lincoln Road"-- with DummyDB window in front:--> FileMaker Pro Advanced got an error: Event not handled.-- with MainDB window in front:-- works, returns result in 0.68 seconds.--set RecID to ID of record 1 of database MainDB whose cellValue of cell cellName = "Lincoln Road"-- works DummyDB window in front/behind-- very slow, takes over 30 seconds!    -- Queries not matching a record (result should be 'missing value', 0 , {}, or something like that):--set RecID to ID of record 1 of database MainDB whose cell cellName = "xxx"-- with DummyDB window in front/behind:--> FileMaker Pro Advanced got an error: Event not handled.--set RecID to ID of record 1 of database MainDB whose cellValue of cell cellName = "xxx"-- with DummyDB window in front/behind:--> FileMaker Pro Advanced got an error: Object not found.   end tell