Skip to main content
Skip table of contents

SaveToFile

SaveToFile Save data to a text file.
Does not match any existing capability in any product, this is an automation exclusive action.

Tag Attributes

Attributes

Attribute Values

Value Description

FilePath

N/A

Output file path
If the file already exists, it is replaced.Required

Text

N/A

Text to write to the file Required

Encoding

File encoding, must be omitted or a value among: ASCII, UTF8, UTF16

Defaults to UTF8.

Append

TRUE/FALSE

Defaults to FALSE.

If set to TRUE and if the target file exists, the new text will be added at the end of the file.

If not, SaveToFile replaces the file.

Example Script

CODE
<ytriaAutomation>

	<SetVar SaveTo="testSaveToFile.txt"/>
	<SetVar testCDATA="USE_CDATA">
	<![CDATA[
		Within this Character Data block I can
		use double dashes as much as I want (along with <, &, ', and ")
		*and* %MyParamEntity; will be expanded to the text
		"Has been expanded" ... however, I can't use
		the CEND sequence. If I need to use CEND I must escape one of the
		brackets or the greater-than sign using concatenated CDATA sections.
		Let's do some <a href=http://www.ytria.com>HTML</a> & then "sleep"
	]]>
	</SetVar>

	<SaveToFile Text="{%testCDATA%}" FilePath="{%SaveTo%}" Encoding="UTF16"/>

	<ShellExecute FilePath = "{%SaveTo%}"/>
	
</ytriaAutomation>

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.