Back

WriteFile

Hello World

Writes text to a local file.

app.WriteFile( file, text, mode, encoding )

See Also: ReadFile.

Example - Append file and get line count

function OnStart()
{
    app.WriteFile( "myFile.txt", "Hello World from Write\n", "Append" );

    var txt = app.ReadFile("myFile.txt");
    var length = txt.split("\n").length;
    app.ShowPopup("myFile contains " + length + " lines");
}
    Copy     Copy All       Run      
string
string: path to file or folder ( “/absolute/...” or “relative/...” )
string: “Append” or “ASCII”
string: “US-ASCII” or “UTF-8” or “UTF-16” or “UTF-16BE” or “UTF-16LE” or “windows-1252” or ISO-8859-1