User Guide

Core objects 23
File Reference object
The File Reference object is used to refer to a specific open file. The following table lists the
methods of the File Reference object, along with their data types and, where appropriate,
acceptable values and notes.
Find object
There are several ways to specify a Find object, depending on what you want to find and
replace. Use the
whatToFind property to specify the type of find operation, along with the
properties that are associated with each legal value for
whatToFind. These properties are listed
in the following tables. Read-only properties are marked with a bullet (•).
Finding and replacing text
Method Data Type Notes
close()
none Closes the current File Reference
object. You are not required to use this
method (the file is closed when the Files
object is destroyed), but it is useful for
controlling access to a file.
readline()
none Reads the next line from the current File
Reference object and returns it as a string.
The end-of-line character(s) are not
included in the string. Returns
null if end-
of-file is reached or if the line is longer than
2048 characters.
write(textString)
string Writes the specified string to the current
File Reference object. No end-of-line
characters are appended; to include one,
use
"\n".
Property Data type Notes
whatToFind
string In the format: "text"
find
string Text to find.
matchCase
Boolean If set to true, the search is case-sensitive.
Defaults to
false.
regExp
Boolean If set to true, the find and replace text is
interpreted as a regular expression. The
default is
false.