6 Replies Latest reply on Apr 12, 2017 6:53 AM by danshockley

    AppleScript 'every document whose' - does not honor 'ignoring case'

    danshockley

      Summary

      AppleScript 'every document whose' - does not honor 'ignoring case'

      Product

      FileMaker Pro

      Version

      12.0v4

      Operating system version

      Mac OS X 10.9.1

      Description of the issue

      When communicating with FileMaker via AppleScript, it is sometimes useful to reference a document by partial name match using AppleScript's command 'every document whose name contains SOMESTRING.' Apparently FileMaker does that name match on a strict case-matching basis. This remains true even when the command is wrapped with a block 'ignoring case' - which is incorrect behavior.

      Steps to reproduce the problem

      Have databases with similar names, but with different case patterns. For example: Invoices_A1, INVOICES_a2, and INVOICES_B.
      Run AppleScript that SHOULD find the two documents whose names match (case insensitively) invoices_a:
      tell application "FileMaker Pro Advanced"
           ignoring case
                every document whose name contains "invoices_a"
           end ignoring
      end tell

      Expected result

      That should return TWO documents, because the 'whose' command should honor the 'ignoring case' block and ignore case when matching document names to the string.

      Actual result

      It instead returns none, because the 'whose' command is not honoring the 'ignoring case' block, but persisting in doing an exact-case match.

      Exact text of any error message(s) that appear

      None. This is a silent error.

      Workaround

      We have to abandon the efficient 'whose' command and instead get a list of EVERY document, then loop over that list and find those that match the string using plain vanilla AppleScript. This wastes time and essentially removes the ability to use the 'whose' command that FileMaker claims to support.

        • 1. Re: AppleScript 'every document whose' - does not honor 'ignoring case'
          TSGal

               DanShockley:

               Thank you for your post.

               I have forwarded your post to our Development and Testing departments for review.  When I receive any feedback, I will let you know.

               TSGal
               FileMaker, Inc.

          • 2. Re: AppleScript 'every document whose' - does not honor 'ignoring case'
            TSGal

                 DanShockley:

                 Sorry for the late response.

                 Testing mentioned that FileMaker does not support "contains <string>".  I recommend that you enter this as a suggestion into our Feature Requests web form at:

            http://www.filemaker.com/company/contact/feature_request.html

                 The entries into this web form populate a database file that is hosted and monitored by Product Management and Development.  Each entry is discussed and considered for possible implementation in a future release.  Although I could copy your post and paste it into the web form, there are a couple of contact questions asked on the web form that only you can answer.

                 TSGal
                 FileMaker, Inc.

            • 3. Re: AppleScript 'every document whose' - does not honor 'ignoring case'
              danshockley

              The Testing Dept is incorrect.

               

              Example code:

              tell application "FileMaker Pro Advanced"

                ignoring case

                every document whose name contains "PR"

                end ignoring

              end tell

               

              When I run that with a bunch of databases open, here is the result I get:

              {document "PROCESS.fmp12" of application "FileMaker Pro Advanced", document "APPROPRIATIONS.fmp12" of application "FileMaker Pro Advanced", document "PROGRAM.fmp12" of application "FileMaker Pro Advanced"}

               

              So, FileMaker does respond to "contains" and it works anywhere within the string. Perhaps they meant to say that FileMaker does not support "ignoring case" in FileMaker's implementation of "contains" ?

              • 4. Re: AppleScript 'every document whose' - does not honor 'ignoring case'
                TSGal

                danshockley:

                 

                Since this issue was reported during the FileMaker Pro 12 timeframe, are you still using FileMaker Pro 12?

                 

                The issue was marked as a suggestion, so it may have been implemented in a later release.  If you aren't using FileMaker Pro 12, what version are you using now?

                 

                TSGal

                FileMaker, Inc.

                • 5. Re: AppleScript 'every document whose' - does not honor 'ignoring case'
                  CamelCase_data

                  In AppleScript in general, "contains" actually already defaults to ignoring the case - you need to add "considering case" if you want to do a case-sensitive comparison.

                   

                  So I think the issue here may lie elsewhere than in FileMaker not supporting "ignore case" - I'm still getting the same results as danshockley in FMPA 15.0.3.

                  2 of 2 people found this helpful
                  • 6. Re: AppleScript 'every document whose' - does not honor 'ignoring case'
                    danshockley

                    The behavior in FileMaker 12 is the same as 15: it does support the "whose … contains" construction, but is case-sensitive, whether or not you wrap it with the "ignoring case" block.

                     

                    So, since at least version 12 (and I believe much earlier than that, although I don't have time to dig up older copies), FileMaker has supported the "contains" operator, but mysteriously forces it to be case-sensitive, when it should not be by default (as @David Wikström pointed out). And, you cannot even tell it to stop being case-sensitive.

                     

                    It seems like Testing Dept should update their own internal documentation that incorrectly tells them "contains" is not a feature of the product. I guess they could argue that FileMaker Incorporated does not support "contains", but FileMaker the software does (if not properly). So, it seems like it should work according to standards.

                    1 of 1 people found this helpful