AnsweredAssumed Answered

FileMaker Pro Advanced Calculated Applescript errors in Lion

Question asked by AdrianBeale on Sep 27, 2011
Latest reply on Jan 10, 2014 by davidhaney

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.

Outcomes