That's a "could not determine the encoding" error.
Difficult to know why without the rest of the AppleScript and the data you are writing to file, but make sure you are using a .txt extension if you aren't already (shouldn't be needed, but a useful nudge), make sure the file paths in the AS and KM action match, and see if you can open the file in a text editor.