Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Writes selected data content from a container to a file path.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Container | 1.6 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
Container | The container where the data is stored. | |
Index or Type | Specify a type (like "JPEG", "PDF ", "GIFf" or "PICT") or the index | "JPEG" |
FilePath | Absolute path to store file. |
Returns "OK" on success or error message.
Export JPEG file:
MBS("Container.Export"; Files::data; "JPEG"; GetAsText(Files::data)+".jpg")
Export all streams in container to individual files:
Set Variable [$container; Value:Test::Image]
#where to save
Set Variable [$DesktopFolder; Value:MBS("Folders.UserDesktop")]
#loop over streams in container
Set Variable [$count; Value:MBS( "Container.GetCount"; $container )]
Set Variable [$index; Value:0]
Loop
#query the type of stream with given index
Set Variable [$type; Value:MBS( "Container.GetType"; $container; $index )]
#write it to a file
Set Variable [$path; Value:$DesktopFolder & "/" & $type]
Set Variable [$r; Value:MBS( "Container.Export"; $container; $index; $path )]
#next
Set Variable [$index; Value:$index + 1]
Exit Loop If [$count = $index]
End Loop
Export a container to desktop:
# get path stored in the container field
Set Variable [ $ContainerPath ; Value: GetAsText ( Contacts::Photo Container ) ]
# get the file name portion
Set Variable [ $ContainerName ; Value: MBS( "Path.LastPathComponent"; $ContainerPath ) ]
# take a folder on the computer, e.g. desktop
Set Variable [ $DesktopFolder ; Value: MBS( "Folders.UserDesktop" ) ]
# build path with file name on that folder
Set Variable [ $FilePath ; Value: MBS( "Path.AddPathComponent"; $DesktopFolder; $ContainerName ) ]
# and export the content of container to that path
Set Variable [ $r ; Value: MBS( "Container.WriteFile"; Contacts::Photo Container; $FilePath ) ]
This function checks for a license.
Created 18th August 2014, last changed 27th January 2023