Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4867 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I'm trying to setup an error capture method for catching errors from an AppleScript that will be called from FileMaker.

The test script is listed below. This script works fine using Apple's Script Editor but I get an error trying to add this script to the Perform AppleScript step in FileMaker. I'm trying to enter the exact script into the Native AppleScript field in the Perform AppleScript step but get the following error on the write command:

"Expected end of line, etc. but found """.

Does the write command need a different syntax than the normal AppleScript syntax?

try

return 100 / 0

on error

set fp to open for access file "Macintosh:Users:tomhorton:Desktop:NewFile" with write permission

write "productID, outputFailed" & return to fp starting at eof

close access fp

end try

Posted

When I wrapped the on error section in a tell section the error was ignored by FileMaker.

try

return 100 / 0

on error

tell Application "Finder"

set fp to open for access file "Macintosh:Users:tomhorton:Desktop:NewFile" with write permission

write "productID, outputFailed" & return to fp starting at eof

close access fp

end tell

end try

  • 1 year later...
Posted

Did you ever figure this out? AFAICT, there is a subtle bug (that I don't understand) that makes the command "write" not compile when it surrounded by tell application "FileMaker"

This works:

set fileRef to open for access (path to desktop as string) & "outfile" with write permission

write "hi mom" to fileRef

close access fileRef

This does not compile (Error: Expected end of line, etc., but found """.)

tell application "FileMaker Pro Advanced"

set fileRef to open for access (path to desktop as string) & "outfile" with write permission

write "hi mom" to fileRef

close access fileRef

end

But this does compile and run correctly

tell application "FileMaker Pro Advanced"

set fileRef to open for access (path to desktop as string) & "outfile" with write permission

tell application "Finder"

write "hi mom" to fileRef

end tell

close access fileRef

end tell

Seemingly FileMaker is changing the meaning of "write" but I don't understand the details. I suspect that this is a bug in FileMaker. Any insight on this?

TIA

Posted

comment—

Your second sentence is (obviously) true. However, "write" does not appear in the dictionaries of either Finder or FileMaker Pro Advanced. The command "write" only occurs in dictionary of the Standard Additions scripting addition. Did you try the examples? I still think that this is ( a ) subtle and ( b ) possibly a bug on the part of FileMaker.

Posted

You are right. I was briefly under the impression that Filemaker doesn't support any of the Standard Additions - but of course it does many of them, so not supporting read or write seems like a weird omission.

This topic is 4867 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.