19
EXTENDING FIREWORKS
The Fireworks Object Model
Las
t
up
d
a
ted
12/8/2009
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
Finding and replacing fonts and styles
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.
readLineUTF8
string
Reads one line from the file that has been opened with UTF8
encoding.
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"
.
writeUTF8
string
Writes text in UTF8 encoding when the file is opened in UTF8
encoding.
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
.
numItemsReplaced
•
Integer
Number of replacements done in a file using Find and Replace.
regExp
Boolean
If set to
true
, the find and replace text is interpreted as a
regular expression. The default is
false
.
replace
string
Text to use as replacement text.
wholeWord
Boolean
If set to
true
, only whole words matching the search text are
found. The default is
false
.
Property
Data type
Notes
whatToFind
string
In the format:
"font"
find
string
Name of font to find.
replace
string
Name of font to use as replacement.