Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Archive.AddText
Add a text file to the archive.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Archive | 13.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
Text | The text to save. | "Hello World" | |
Encoding | The text encoding for text parameter. Default is native. |
"UTF-8" | |
FileName | The file name to use. May contain relative path parts. |
"Documents/test.txt" | |
TimeStamp | Available in MBS FileMaker Plugin 14.0 or newer. The timestamp to use in the archive for the file. Can be empty to use today. |
"" | Optional |
Result
Returns OK or error.
Description
Add a text file to the archive.Please use Archive.Create before adding the first file and use Archive.Close after the last file to finish.
Examples
Compress PDF containers into a zip file with a readme file:
Set Variable [ $path ; Value: MBS( "Path.AddPathComponent"; MBS( "Folders.UserDesktop" ); "test.zip" ) ]
Set Variable [ $r ; Value: MBS( "Archive.Create"; "zip"; "deflate"; $path) ]
If [ MBS("IsError") ]
Show Custom Dialog [ "Failed to create zip archive." ; $r ]
Exit Script [ Text Result: ]
End If
#
Set Variable [ $r ; Value: MBS( "Archive.AddText"; "PDF documents related to order " & Orders::ID; "UTF-8"; "ReadMe.txt" ) ]
Go to Record/Request/Page [ First ]
Set Variable [ $destPage ; Value: 1 ]
Loop
Set Variable [ $r ; Value: MBS( "Archive.AddContainer"; Orders::PDF) ]
Go to Record/Request/Page [ Next ; Exit after last: On ]
End Loop
Set Variable [ $r ; Value: MBS( "Archive.Close") ]
See also
- Archive.AddContainer
- Archive.AddFile
- Archive.Close
- Archive.Create
- Folders.UserDesktop
- IsError
- Path.AddPathComponent
Release notes
- Version 14.3
- Fixed Archive.AddText function to allow relative paths in file name parameter.
- Version 14.0
- Added new parameter for Archive.AddContainer, Archive.AddFile and Archive.AddText to pass a timestamp to use.
- Version 13.1
- Added Archive.Create, Archive.AddContainer, Archive.AddFile, Archive.AddText and Archive.Close functions.
Blog Entries
- Compress and Send
- MBS FileMaker Plugin, version 14.3pr5
- Neues MBS Plugin 14.0 für Claris FileMaker
- MBS FileMaker Plugin 14.0 for Claris FileMaker
- MBS FileMaker Plugin, version 14.0pr7
- New in MBS FileMaker Plugin 13.1
- Build archives on the fly
- MBS FileMaker Plugin, version 13.1pr3
FileMaker Magazin
This function checks for a license.
Created 13th February 2023, last changed 5th January 2024