0 Replies Latest reply on Aug 30, 2009 8:49 AM by jbarnum

    AppleScript table references do not work with an empty found set

    jbarnum

      Summary

      AppleScript table references do not work with an empty found set

      Description of the issue

      FileMaker Product(s) involved:FileMaker Pro Advanced 10.0v3 (I believe this happened on previous versions as well) Operating System(s) involved:Mac 10.6 (I believe this happened on previous versions as well) Detailed description of the issue:The following AppleScript works as expected (returns the matching record) with one or more records in the found set, even if the record matching this criteria is not in the found set: tell application "FileMaker Pro Advanced"tell table "TestFile" of database "Test File"first record where cell "key" is "value"end tellend tell  The same script always fails if there are zero records in the found set. Exact steps to reproduce the issue:Copy and paste the previous AppleScript into your script editor, substituting 'TestFile', 'Test File', 'key' and 'value' with real values in your test database. Run the AppleScript with one or more records in the found set. Now omit all records so you have an empty found set and run again. Expected Result:A list of cell values for the matching record, such as {"value", «data PICT», "", "", "", "", ""}. This should be the same result regardless of your found set, since the 'table' and 'database' references are supposed to work independently of the found set.Actual Result:Works as expected for one or more records. If there are zero records, the script execution fails. Exact text of any error message(s) that appeared:tell application "FileMaker Pro Advanced"get record 1 of table "TestFile" of database "Test File" whose cell "key" = "value"--> error "Event not handled." number -1708Result:error "FileMaker Pro Advanced got an error: Event not handled." number -1728 from record 1 of table "TestFile" of database "Test File" whose cell "key" = "value"  Any additional configuration information/troubleshooting that is relevant to the issue:N/A Any workarounds that you have found:Adding a 'show every record' every time I need to reference a record works around the problem, like this: tell application "FileMaker Pro Advanced"tell table "TestFile" of database "Test File"show every recordfirst record where cell "key" is "value"end tellend tell