Method to write a string to a file. This function can create new files. Existing files will be overwritten. You can also use the method .content().
Note: This method is different from the default ExtendScript method write()
.
var content = "String to insert into file"; var file = new File("C:/myfile.txt"); file.writeFile(content);
Parameter | Data type | Required | Description |
---|---|---|---|
content | string | The string to write to the file | |
encoding | string | The encoding to write the file. When not specified the default encoding UTF-8 is used. |
This method has no return values.