Experiences on the Front Lines of User Interfaces and Web Development

Fireworks CS4 automated scripting with Javascript

Finding any information on command line scripting for Fireworks CS4 was difficult. Below is an example script to get you started, along with some hard-to-find resources below. Feel free to add other examples / links to the comments section, so that hopefully this page can become a helpful resource to others.

This script goes across all layers in a Fireworks animated GIF source file (PNG format). It replaces all text layers of a specific name with specific text. I used Ruby to dynamically generate the "process_image( ... )" calls, as a way to iterate through many source files and save animated GIF's with variable text in them.
{gfm-js-extract-pre-1}
Save the file with a .jsf extension, and to call it from a Ruby command script, simply do:
system( "open script_fw.jsf" )


Article with some information, and a few helpful links to resources:
http://www.adobe.com/devnet/fireworks/articles/demo_current_document_command.html

Link to PDF API documentation:
http://help.adobe.com/en_US/Fireworks/9.0_Extending/fireworks_cs3_extending.pdf

Fireworks Help
http://help.adobe.com/en_US/Fireworks/10.0_Using - (Automating Tasks)

Javscript source of existing Fireworks plugins found here (on a Mac machine using CS4). This is a good way to learn the scripting language by viewing plugins' source code:
~/Applications/Adobe Fireworks CS4/Configuration/commands/
comments powered by Disqus