Automating Tasks

     

Automating Tasks

Designing Web sites often involves repetitive tasks, such as optimizing images or converting images to fit within certain constraints. Think of any major online retailer's Web site and the work that went into resizing, optimizing, and exporting hundreds of product shots.

A wonderful capability of Fireworks is its capability to automate and simplify many of those tedious drawing, editing, and file-conversion tasks.

Fireworks offers three sets of tools that enable you to automate these repetitive tasks:

  • Find and Replace ” Used to search for and replace elements within a file or multiple files. You can specify an asset, such as text, color , URLs, and fonts, and find and replace that asset in a PNG file.

  • Batch Process ” Used to convert entire groups of image files into other formats or to change their color palettes. Batch Process also applies custom optimization settings to groups of files, as well as resize a group of files.

  • Commands ” Used to create shortcuts for commonly used features or to create a script that can perform a complex series of steps. Advanced users can automate complex tasks by writing JavaScript commands and then executing them in Fireworks. These commands are beyond the scope of this book, but we will discuss them briefly later in this chapter in "Extending Fireworks," page 780.

Find and Replace

Find and Replace comes into play when you need to make global changes to elements of source PNG files. Elements that can be modified using Find and Replace include text, fonts, colors, and URLs.

Note that changes made with Find and Replace are undoable. For example, you search your source PNG files for the word "insomnia" and replace it with the word "sleepless." If you decide to change the word again, you cannot undo that change. However, you can run another Find and Replace. Run a find for the word "sleepless" and replace it with the original word "insomnia."

All Find and Replace commands are handled through the Find panel. Access it by choosing Window, Find, or Edit, Find (Figure 28.1).

Figure 28.1. All Find and Replace operations are handled through the Find panel.

graphics/28fig01.jpg


From the Search pop-up menu, choose a source for the search:

  • Search Selection ” Finds and replaces elements in the currently selected objects and text.

  • Search Frame ” Finds and replaces elements in only the current frame.

  • Search Document ” Finds and replaces elements in the active document.

  • Search Files ” Finds and replaces elements across multiple files.

From the Find pop-up menu, select an attribute to search for. The options in the panel change according to your selection.

Next , select a find-and-replace operation:

  • Find ” Locates the next instance of the element.

  • Replace ” Changes a found element with the contents of the Change To option.

  • Replace All ” Finds and replaces every instance of a found element in the search range.

As long as a file is not open , the act of replacing objects in multiple files automatically saves those changes. To give yourself some extra insurance, you can create backups when you use Find and Replace in multiple files.

With the Find panel open, click the Options menu in the top-right corner of the panel. Select Replace Options to launch the Replace Options dialog box (Figure 28.2).

Figure 28.2. The Replace Options dialog box specifies how multiple-file Find and Replace operations are handled.

graphics/28fig02.jpg


Select from among the following options:

  • Save and Close Files (if checked) ” This option has Fireworks save and close selected files that are not currently open when the Replace operation is completed.

  • Backup Original Files ” This option has three options to choose from: select Choose No Backups to have no file backups made; select Overwrite Existing Backups to create one set of backups and overwrite them if multiple operations are performed; and choose Incremental Backups to create a set of backups for every Find and Replace operation completed.

Click OK to save the settings.

Batch Processing

Batch Processing is often performed as a series of simultaneous tasks on a group of files. In contrast to Find and Replace, Batch Processing is used on exported files such as GIFs and JPEGs.

The best way to create a batch process is to use the Batch Wizard (File, Batch Process). The wizard presents three screens, enabling you to accomplish a batch process in a jiffy.

The first screen (Figure 28.3) allows you to add files that will be used to create the batch. Files can be added from more than one directory.

Figure 28.3. The first screen in the Batch Process wizard is where you add files to create the batch.
graphics/28fig03.jpg

When you have created the batch, click the Next button to continue.

The second screen (Figure 28.4) is used to add tasks that will tell Fireworks what to do to the files in the batch. The following are some of the most commonly used tasks:

  • Export ” This task specifies how the batch will be re-exported. When selected, all the export presets appear.

  • Scale ” This task scales the graphics to a specific size (like thumbnails), to fit an area, or to a percentage.

  • Find and Replace ” This task opens the Batch Replace dialog box so you can use the Find and Replace operations in PNG files.

  • Rename ” This task allows you to add a prefix or suffix to the files.

  • Commands, Convert to Grayscale ” This command converts the batch images to grayscale and is frequently used in Web design.

Figure 28.4. The second screen in the Batch Process wizard is where you add tasks that are to be applied to the batch.
graphics/28fig04.jpg

When you have added your tasks, click the Next button to continue.

The last screen of the wizard (Figure 28.5) is where you specify the files' output destination, as well as what should happen to the original files. If the results are satisfactory, you can even save the batch process as a Scriptlet. A Scriptlet is a script that you can use again to repeat the exact batch process in the future.

Figure 28.5. The third screen in the Batch Process wizard is where you choose the output destination and specify the fate of the original files.
graphics/28fig05.jpg

Make your selections and click the Batch button. Fireworks does all the work so you can kick back and take a much deserved break!



Using Macromedia Studio MX 2004
Special Edition Using Macromedia Studio MX 2004
ISBN: 0789730421
EAN: 2147483647
Year: N/A
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net