The Fireworks Object

The Fireworks object is a global object, which you can use to set or retrieve properties that relate to the current operating environment. (The App object that was used in Fireworks 3 is supported for backward compatibility, but its use is deprecated in favor of the Fireworks object.)

The following table lists the properties of the Fireworks object, along with their data types and, where appropriate, acceptable values and notes. Read-only properties are marked with a bullet (•).

Note: For information on how to format nonstandard data types, such as rectangle or point, see Formatting nonstandard data types.

Refer to the Fireworks object by using fw.propertyName or fireworks.propertyName. Note that fireworks must be lowercase.

Property

Data type

Notes

activeTool

string

The active tool in the application.

activeViewScale

float

The scaling (zoom value) of the active view. 1.0=100% of the normal view.

appBatchCodeDir

string

The path to the Batch Code directory, which is expressed as file://URL.

appDir

string

The path to the directory that contains the Fireworks application, which is expressed as file://URL.

appExportSettingsDir

string

The path to the Export Settings directory, which is expressed as file://URL.

In Fireworks, this folder is stored on a per-user basis on multiuser systems. Even on single-user systems, this folder is not inside the Fireworks installation directory.

appFavoritesDir

string

The path to the URL Libraries directory, which is expressed as file://URL.

In Fireworks, this folder is stored on a per-user basis on multiuser systems. Even on single-user systems, this folder is not inside the Fireworks installation directory.

appHelpDir

string

The path to the directory that contains the Fireworks help file, which is expressed as file://URL.

appHtmlCodeDir

string

The path to the HTML Code directory, which is expressed as file://URL.

appJsCommandsDir

string

The path to the Commands directory, which is expressed as file://URL.

appJsExtensionsDir

string

The path to the JSExtensions directory, which is expressed as file://URL.

appMacCreator

string

In the format: "MKBY"

appMacJsfFileType

string

In the format: "TEXT"

appName

string

The name of the application. This attribute is part of the common API, so it also appears as app.appName (as implemented in Adobe Dreamweaver).

appPatternsDir

string

The path to the Patterns directory, which is expressed as file://URL.

appPrefsDir

string

The path to the Preferences directory, which is expressed as a file://URL.

appPresetsDir

string

The path to the Presets directory, which is expressed as file://URL.

In Fireworks, this folder is stored on a per-user basis on multiuser systems. Even on single-user systems, this folder is not inside the Fireworks installation directory.

appSettingsDir

string

The path to the Settings directory, which is expressed as file://URL.

appSmartShapesDir

string

The path to the application’s Auto Shapes directory, which is expressed as file://URL.

appSmartShapeToolsDir

string

The path to the application’s Auto Shape Tools directory, which is expressed as file://URL.

appStylesDir

string

The path to the Styles directory, which is expressed as file://URL.

In Fireworks, this folder is stored on a per-user basis on multiuser systems. Even on single-user systems, this folder is not inside the Fireworks installation directory.

appSwfCommandsDir

string

The path to the SWF Commands directory, which is expressed as a file://URL.

appSymbolLibrariesDir

string

The path to the Libraries directory, which is expressed as file://URL.

appTemplatesDir

string

Returns the path of the Templates directory present at the location where you have installed Fireworks.
Var tempLoc=fw.appTemplatesDir; 
alert(tempLoc);

appTexturesDir

string

The path to the Textures directory, which is expressed as file://URL.

appXtrasDir

string

The path to the Xtras directory, which is expressed asfile://URL.

batchStatusString

string

The string that currently appears in the Batch Progress dialog box. Set this property to change the string being displayed. Use with progressCountCurrent and progressCountTotal.

currentScriptDir

string

The path to the directory of the currently running script, which is expressed as a file://URL (or could be null).

This path goes to the directory in which the script resides, not a full file path to the script itself (it excludes the script’s filename).

currentScriptFileName

string

The filename of the currently running script (or could be null).

This name is the script’s filename, not the full path.

dialogs

object

Provides access to an instance of the Dialogs class, which opens specific dialog boxes.

dismissBatchDialogWhenDone

Boolean

If set to true, Fireworks will automatically close the Batch Process dialog box when the script finishes. This function has no effect if the Batch Process dialog box does not appear.

documentList

array

Array of the current open Document objects (for more information, see The Document object). If no document is open, it returns an array of length zero.

documents

array

Array of the current open Document objects (for more information, see The Document object). If no document is open, returns an array of length zero.

ellipseBCPConst

float

A fixed value of 0.55229187012 used to calculate the distance between a point and its predecessor/successor for a perfect circle. For example, for a circle with a radius of 100 pixels, the predecessor/successor is 100*fw.ellipseBCPConst pixels away from the point itself.

errorReportingOK

Boolean

If set to true, Fireworks will allow posting an error while a script is running.

files

object

The FilesClass object used to perform file operations (open, close, delete, and so on).

getDynamicSWFURL

string

Returns the location of the SWF file.

getEndBackgroundColor

color

Returns the end color for the background gradient. This function is only useful for the Windows platform.

getStartBackgroundColor

color

Returns the start color for the background gradient. This function is only useful for the Windows platform.

historyPalette

object

History panel object. There are no DOM properties for the History panel, only API calls. For more information, see History panel functions.

isConnectedToInternet

integer

Returns whether the operating system is connected to the Internet. The Start Page has a dynamic content panel that loads content from the Internet. The Start Page queries this property before attempting to download the dynamic content.

mruRecentFilesList

array

Array of recent open files. If there are no open files, returns an array length of zero.

mruRecentFileNames

array

Array of recent open file names. If there are no open files, returns an array length of zero.

platform

string

The string "mac" if Fireworks is running on the Macintosh, or "win" if running on Windows.

progressCountCurrent

integer

The first number (x) that appears in the Batch Progress dialog box, in the “File x of y” field. Set this property to change the number.

progressCountTotal

integer

The second number (y) that appears in the Batch Progress dialog box, in the “File x of y” field. Set this property to change the number.

screenRect

rectangle

The size of the main screen on this computer, in pixels. Useful for positioning windows or panels.

selection

array

Array of the selected objects in the active document. If nothing is selected, it returns an array of length zero. If no document is open, it returns null.

selectedMask

object

If a single item is selected and that item is a mask, this property returns an ElementMask object (for more information, see ElementMask object); otherwise, it returns null.

styles

array

Array of the Style object that is currently loaded in the Style panel (for more information, see Style object).

textInsertionIndex

integer

Insertion index into the current active text object. If there is no text selected, returns a value of -1.

textInsertionLength

integer

Insertion length into the current active text object. If there is no text selected, returns a value of -1.

textOutputEncoding

string

The default text encoding for any text file that the JavaScript interpreter generates.

Use "iso-8859-1" for ASCII or "utf-8" for Unicode.

userJsCommandsDir

string

The path to the user-level Commands directory, which is expressed as a file://URL.

In Fireworks, this folder is stored on a per-user basis on multiuser systems. Even on single-user systems, this folder is not inside the Fireworks installation directory.

userSmartShapesDir

string

The path to the user’s Auto Shapes directory, which is expressed as a file://URL

userSmartShapeToolsDir

string

The path to the user’s Auto Shape Tools directory, which is expressed as a file://URL.

userSymbolLibrariesDir

string

The path to the user’s Symbol Libraries, which is expressed as file://URL.

userSwfCommandsDir

string

The path to the user-level SWF Commands directory, which is expressed as a file://URL.

In Fireworks, this folder is stored on a per-user basis on multiuser systems. Even on single-user systems, this folder is not inside the Fireworks installation directory.

xhtmlFormat

Boolean

Determines whether the JavaScript interpreter should output XHTML formatted files or HTML formatted files; XHTML (true) or HTML (false).