|Mac & Win
Writes a text file with the given text.
(old name: String.WriteTextFile)
|The text to save.
|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.
|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.
If you need to create directory first, please use Files.CreateDirectory function.
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
- Shell/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
- New in MBS FileMaker Plugin 11.4
- 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
- Comparing Base Elements Plugin to MBS FileMaker Plugin
- Filemaker: Export Text to File
- MonkeyBread Software Releases the MBS Filemaker plug-in in version 2.4
- MBS Filemaker Plugin 2.4 release notes
This function is free to use.
Created 18th August 2014, last changed 26th October 2023