Filemaker: Export Text to File
Now sometimes you need more. Like you want to export values in a variable without putting them in a field. You may want to export text as UTF-8, MacRoman, Windows ANSI or some other text encoding instead of UTF-16LE. With String.WriteTextFile you can specify the text encoding you want. Maybe you want to pass text before through String.ReplaceNewline to make sure the right newline character is used. For example CR for Classic Mac, CRLF for Windows or LF for Unix Mac OS X. Next you may want to write a log file and just append to a file with String.AppendTextFile.
For containers you can export them with Container.Export. There you can specify a container as field or variable and a path to write to. And you select what to export. Like if your container contains a TIFF picture, you can either export the TIFF or the preview JPEG. The function Container.GetTypes tells you which types are in a container.
If you like, please check Container.Export, String.AppendTextFile, String.WriteTextFile or String.ReplaceNewline.