Site Tools


Sidebar

New release candidate 3 available: 2020-06-09 "Hogfather". upgrade now! [51.2] (what's this?)
New release candidate 2 available: 2020-06-01 "Hogfather". upgrade now! [51.1] (what's this?)
New release candidate available: 2020-06-01 "Hogfather". upgrade now! [51] (what's this?)
Hotfix release available: 2018-04-22c "Greebo". upgrade now! [50.3] (what's this?)
file:readfile

.readFile()

Method to read the contents of a file. The method returns the content of the file. Line feeds are preserved. You can also use the method .content().

Note: This method is different from the default ExtendScript method read().

Usage

var file = new File("C:/myfile.txt");
var filecontents = file.readFile();

Parameters

Parameter Data type Required Description
encoding string The file encoding used for reading the file. Default encoding is UTF-8

Return Values

Value Meaning
null The file does not exist
string The contents of the file
file/readfile.txt · Last modified: 2020/02/26 17:10 (external edit)