There are a few commands which run fine in vanilla AppleScript, but cause errors inside a FileMaker tell block; and anything that is not explicitly inside another app's tell block is inside FileMaker's when using Perform AppleScript. There's a pretty simple fix however, which is to wrap the incompatible commands inside another app's. For example:
tell application "Finder"
the read/write file commands
or, perhaps better,
tell application "System Events"