Writing Text to a File

### Writing Text to a File

Document ID: IR10001
• AutoPlay Media Studio 5.0 Standard Edition
• AutoPlay Media Studio 5.0 Professional Edition

### DISCUSSION

When writing information to a text file, there are three options:

1. We can create a new text file and write our data to it.
2. Data can be "added on" to the end of an existing text file, this is known as "appending" a text file.
3. Data in an existing text file can be overwritten.

In AutoPlay Media Studio 5.0, these different options are accomplished by toggling the Append value of the TEXT FILE > WRITE action (a new file will always be created if the target file does not exist).

As an example, we will write "Hello, my name is John Doe" to a text file, overwriting its contents. This is accomplished with the following action:

TextFile.WriteFromString("c:\text.txt", "Hello, my name is John Doe", false);