Components Crossplatform Mac & Win Server Client Old Deprecated Guides Examples Videos
New in version: 10.5 11.0 11.1 11.2 11.3 11.4 11.5 12.0 12.1 12.2 Statistic FMM Blog
Writes a text file with the given text.
|Text||2.4||✅ Yes||✅ Yes||✅ Yes||✅ Yes||✅ Yes||Paid|
(old name: String.WriteTextFile)
|Text||The text to save.||"Hello World"|
|FilePath||The native file path. Something like "/Users/cs/desktop/test.txt" on Mac and "C:\Programs\Data\test.txt" on Windows. Files without path end in the root directory on Mac.||"test.txt"|
|Encoding||The text encoding for text parameter.
Default is native.
Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ.
Returns "OK" or an error message.
DescriptionWrites a text file with the given text.
You have to decide which encoding to use (if not native). We support a few encodings, but we can add more if you need something special.
Please use Text.ReplaceNewline to define which line endings the file has.
In order to append to a text file, you can use Text.AppendTextFile instead.
If text encoding doesn't support given characters, they are converted to close match if possible or replaced by question marks.
Existing file is overwritten if permissions allow it.
Added support for UTF-16 in plugin version 7.2. You can pass UTF-16, UTF-16LE or UTF-16BE for encoding.
See Text.ReadTextFile for reading text files.
This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.
Write UTF-8 file with some text:
Write a test text file on Mac:
Write text in UTF-8 with Byte Order Mark (BOM):
Write a test text file on Win:
Write RTF file:
Export data via SQL to text file:
Write UTF-16 with LE, BE or default with BOM:
Write UTF-8 CRLF file:
Write a HTML file and an image file to load in web viewer:
Read and write file to change some text:
- Version 12.2
- Version 7.2
- Added Text.WriteTextFile support for UTF-16 writing.
- CURL/Email/Email Parser and Preview
- CURL/Email/IMAP Email
- RunTask/Run Shell Script on Mac
- Text functions/Text to RTF or HTML
- Text functions/Write Text File
- Utility functions/Split DDR
- MBS FileMaker Plugin, version 12.2pr1
- Define hot keys for functions in the FileMaker development
- FileMaker 18 File Script Steps vs. BinaryFile functions
- Xojo Web Apps on FileMaker Cloud Server
- CSV functions in MBS FileMaker Plugin
- MBS FileMaker Plugin, version 7.2pr1
- MBS FileMaker Plugin, version 5.2pr5
- Filemaker: Export Text to File
- MonkeyBread Software Releases the MBS Filemaker plug-in in version 2.4
- MBS Filemaker Plugin 2.4 release notes
Created 18th August 2014, last changed 28th January 2021
Feedback: Report problem or ask question.