User Guide

Core objects 17
Here is an alphabetical list of the properties of the Errors object:
EAppAlreadyRunning, EAppNotSerialized, EArrayIndexOutOfBounds,
EBadFileContents, EBadJsVersion, EBadNesting, EBadParam, EBadParamType,
EBadSelection, EBufferTooSmall, ECharConversionFailed, EDatabaseError,
EDeletingLastMasterChild, EDiskFull, EDuplicateFileName, EFileIsReadOnly,
EFileNotFound, EGenericErrorOccurred, EGroupDepth, EIllegalThreadAccess,
EInternalError, ELowOnMem, ENoActiveDocument, ENoFilesSelected,
ENoNestedMastersOrAliases, ENoNestedPasting, ENoSliceableElems,
ENoSuchElement, ENotImplemented, ENotMyType, EOutOfMem, EResourceNotFound,
ESharingViolation, EUnknownReaderFormat, EUserCanceled, EUserInterrupted,
EWrongType
Files object
The following table lists the methods of the Files object, along with their data types and, where
appropriate, acceptable values and notes.
Method Data type Notes
close()
none Closes the file referred to by this Files
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.
copy(docname1, docname2) string, string Copies the file specified in the first argument
to the file specified in the second argument.
Each argument must be the name of a file,
which is expressed as file://URL. Only files
(not directories) can be copied. The files do
not need to reside on the same drive, and the
method does not overwrite a file if it already
exists. Returns a value of
true if the copy is
successful;
false otherwise.
createDirectory(dirname)
string Creates the specified directory. Returns true
if successful;
false otherwise.
createFile(fileURL, fileType,
fileCreator)
string, string,
string
Creates the specified file. The file must not
already exist. The first argument is the name
of the file, which is expressed as file://URL.
The last two arguments let you specify the
file type and file creator strings. The
fileType
and
fileCreator strings should each be
strings of exactly four characters in length, for
example:
Files.createFile(newFile,".txt","FWMX");
deleteFile(docOrDir)
string Deletes the specified file or directory.
Returns
true if successful; false if the
file or directory does not exist or cannot
be deleted. Compare with
deleteFileIfExisting().