Alan, You've half answered your own question with the final AppleScript. As the "write" syntax is in the Standard Additions it isn't something that needs to be performed in the tell block for FileMaker Pro Advanced (and really shouldn't). If you need to capture some information from FileMaker Pro Advanced, capture that in a variable and then use the other code outside of the tell block. For instance, the following will work:
tell application "FileMaker Pro Advanced"
-- Do FileMaker stuff here
set FileRef to open for access (path to desktop as string) & "outfile.txt" with write permission
write "hello world" to FileRef
close access FileRef
What are you trying to achieve by performing the script code from within the FileMaker Pro Advanced tell block?
I am trying to achieve syntactical convenience. This should work within or outside of a tell block. Obviously, I do know how to work around it, and one can always put a "tell me to" at the beginning of a statement, but it is really annoying to end a tell block, do one statement, and then enter a new tell block.
I posted this here because FileMaker Inc told me that this is where to post bug reports, and I was hoping to have this report evaluated as a possible bug to be entered into Filemaker's bug database. There is no evidence that FileMaker staff actually read these (at least, they haven't commented).
Actually, Bug Reports should be posted to "Report an Issue". See the tab at the top of this screen.