In Filemaker you sometimes want to export text. For that people usually use the Export Field Contents script step in Filemaker. There you can specify a field and a filename. Filename can include variables and specify different paths on Mac and Windows. Field can be a field you select or the current field. If you export a container, you get the file written there (make sure you have right extension!) and for text it writes an UTF-16LE encoded text 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.