Adobe 38039927 - Fireworks CS3 - PC Extended User Manual page 20

Extending fireworks
Hide thumbs Also See for 38039927 - Fireworks CS3 - PC:
Table of Contents

Advertisement

Method
open(docname, bWrite)
rename(docname,
newPlainFilename)
setFilename(docname,
newPlainFilename)
swap(docname1, docname2)
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.
Method
close()
readline()
write(textString)
Data type
Notes
string, Boolean
The first argument must be expressed as
file://URL. Opens the specified file for reading or
writing. If the second argument is
opens for writing; otherwise it opens for reading.
If the file cannot be opened, returns
otherwise, returns a File Reference object.
string, string
The
URL to the file that you want to rename.
The
new name to assign to the file.
The
newly renamed file if successful; otherwise Fire-
works returns
string, string
The first argument must be expressed as
file://URL. Returns a file URL with
replaced by
example,
name("file:///work/logo.png",
"oldlogo.png")
"file:///work/oldlogo.png"
method does not affect the file on disk; it simply
provides a convenient way to manipulate file
URLs. To change the name on disk, use
rename()
string, string
Each argument must be expressed as a file://URL.
Swaps the contents of the two specified files, so
that each file contains the contents of the other
file. Only files (not directories) can be swapped,
and both files must reside on the same drive.
Returns
otherwise.
Data Type
Notes
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.
none
Reads the next line from the current File Reference
object and returns it as a string. The end-of-line char-
acter(s) are not included in the string. Returns
if end-of-file is reached or if the line is longer than
2048 characters.
string
Writes the specified string to the current File Refer-
ence object. No end-of-line characters are appended;
to include one, use
true
argument is a file path or a file
docname
newPlainFilename
argument is the
rename
method returns a URL path of the
null
.
docname
newPlainFilename
Files.setFile-
returns
.
true
if the swap is successful;
"\n"
.
ADOBE FIREWORKS CS3
Extending Guide
, the file
;
null
. For
. This
false
null
16

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fireworks cs3

Table of Contents