2 Replies Latest reply on Jan 10, 2014 11:47 AM by davidhaney

    FileMaker Pro Advanced Calculated Applescript errors in Lion

    AdrianBeale

      Summary

      FileMaker Pro Advanced Calculated Applescript errors in Lion & Snow Leopard

      Version

      Filemaker Pro Advanced 11.0 v2 11.0v3 11.0v4

      Operating system version

      10.7, 10.6.8

      Description of the issue

      In Filemaker Pro Advanced (only, does not happen in Filemaker Pro) certain Calculated Applescripts give an error:

      "A “"” can’t go after this identifier."

      We use a lot of Applescripting from Filemaker and this is the only script we have this issue with (so far).

      The script itself is very simple:

      "set theDestination to \"" & <> &".pdf\" as alias¶

      set fileSize to size of (info for theDestination)¶

      tell application \"FileMaker Pro\"¶

      set cell \"applescript::AS_variables\" to fileSize¶

      end tell"

      Steps to reproduce the problem

      Recreate the code:

      "set theDestination to \"" & <> &".pdf\" as alias¶

      set fileSize to size of (info for theDestination)¶

      tell application \"FileMaker Pro\"¶

      set cell \" b_field_name \" to fileSize¶

      end tell"

      In a calculated applescript, set up the above applescript so that "<
      >" is replaced with a field or variable which contains the path to a file.
      b_field_name should be a field in the current layout which the size of the file can be placed in.
      Run the script.

      Expected result

      the field "b_field_name" should now contain the file size (in bytes) of the referred to at the start of the script.

      Actual result

      The field "b_field_name" now contain the file size (in bytes) of the referred to at the start of the script.  However an error "A “"” can’t go after this identifier." appears in a dialog, which disrupts the flow of the script until the user intervenes. This script is run thousands of times a day automatically.

      Exact text of any error message(s) that appear

      "A “"” can’t go after this identifier."
      Applescript error -2741

      Configuration information

      Database is running on a local network, from filemaker server database.

      Workaround

      Adding try as below:
      "set theDestination to \"" & <> &".pdf\" as alias¶
      set fileSize to size of (info for theDestination)¶
      try¶
      tell application \"FileMaker Pro\"¶
      set cell \" b_field_name \" to fileSize¶
      end tell¶
      end try"

      suppresses the error, however if there ever is an issue that prevents the field from being set correctly, we will not be alerted. This is definitely not optimal.

        • 1. Re: FileMaker Pro Advanced Calculated Applescript errors in Lion & Snow Leopard
          TSGal

          Adrian Beale:

          Thank you for your post.

          With FileMaker Pro now being Cocoa compliant, the timing and running of scripts is very different under Cocoa.  Also, Applescript scripting is not synchronous.  It will sometimes allow events to be processed out of order, or complain when a script is queued.  You may want to insert some pause script steps for a couple of seconds before continuing.

          I have also forwarded your similar issue to our Development and Testing departments for additional review.  When more information becomes available, I will let you know.

          TSGal
          FileMaker, Inc.

          • 2. Re: FileMaker Pro Advanced Calculated Applescript errors in Lion & Snow Leopard
            davidhaney
             I ran into the same error ... "A “"” can’t go after this identifier."  on a simple routine... tell application "Finder"      set fileList to name of every file of folder "DAV03:Films (#-M):A:" end tell tell application "FileMaker Pro Advanced"      set cell ("Field1") of current record to (fileList as text) end tell I found the problem in the line .. tell application "FileMaker Pro Advanced" I had changed the app name in Finder to FileMaker Pro 12 Advanced. When I changed the app name in back to FileMaker Pro Advanced OR if I changed the applescript string to match the exact name of the app in the /Application folder in Finder, it works fine. David Haney Advance Database Systems