![]() |
< Day Day Up > |
![]() |
19.1 The History Panel RevisitedAs you work on a Web page, Dreamweaver keeps track of everything you do. You can see a list of your actions梱our history梚n the History panel. Each document has a separate history, which Dreamweaver discards when you close the document or quit the program. You can use the History panel to quickly undo or redo multiple actions (Section 2.5.2), but that's only the tip of the iceberg. You can also use it to replay and record a series of actions you wish to repeat. If you've ever used macros in Microsoft Word or actions in Adobe Photoshop, you'll probably get the hang of this feature quickly. To open the History panel, choose Window 19.1.1 Replay Your StepsTo replay a step in the History panel, click the step's name to highlight it. You can also select multiple steps by using one of these methods:
Now, when you click Replay (see Figure 19-1), Dreamweaver replays the selected steps. Unfortunately, you can't reorder the steps; they always play from the top of the list to the bottom. The History panel lists every little step you've taken while working on the current document梕ven typos. You can replay one or more actions on the list, copy them for use in another document, or save them as a command in the Commands menu. If Dreamweaver can't replay an action, such as a mouse click, it appears with a red X next to it. Furthermore, you can't replay two continuous steps if you clicked or dragged in the document in between them (you'll see a solid line in the History list separating such steps). Dreamweaver will merely replay the first selected step. The History slider indicates where you are in the document's history.![]() Once you've created a series of steps, you can reuse it. For example, say you format a paragraph as a bulleted list and apply a custom style to it. Once Dreamweaver records these steps in the History panel, you can select more text and replay those steps to format it the same way. Now imagine that instead of a two-step process, you have a ten-step chore that involves not only keystrokes, but multiple visits to the Insert bar and Property inspector梱ou can begin to see the power of this feature.
19.1.2 Exceptions and ErrorsUnfortunately, Dreamweaver can't record and play back everything. The exceptions generally involve making changes in certain dialog boxes or moving objects with the mouse. For example, you can't record tasks you perform in the Modify Page Properties dialog box. And you're left to your own devices when you want to click, drag, or drop a graphic in the document window. On the other hand, not everything you do with the mouse is off-limits to the History panel. It can track most common tasks, like clicking the Insert bar, choosing a menu item, or clicking in the Property inspector to set a property. Also, you can avoid using many mouse movements by using equivalent keystrokes, which Dreamweaver can record. (See the box below.) If you take a step, such as a mouse drag, that Dreamweaver can't replay, a red X appears next to it in the History panel. A line between two actions also indicates a step that can't be repeated. This problem usually arises when you've clicked in the document window (to deselect a selected image, for example). If you get into the habit of deselecting an object in the document window by pressing the keyboard's arrow keys instead, you'll find your History steps more fully replayable.
19.1.3 Copying and Pasting ActionsEach document has its own history. Thus, if you work on one page and then switch to another, the History panel changes to reflect only the actions you performed on the new document. The biggest drawback of this quirk is that you can't make a series of steps in one document to replay in another. For example, while working on your home page, you might click the Date object in the Insert bar to insert the current date (see Section 2.1.2) and then choose a format for the date in the dialog box. You want to place the date on another page using the same format. But when you switch to that page and click Replay on the History panel, your steps aren't there! Fortunately, there's a workaround: ye olde copy/paste routine. Select the steps you
want to copy (see "Replay Your Steps" in Section 19.1.1, for selection techniques), and
then click the Copy selected steps button (see Figure 19-1) on the History panel. (The
regular copy shortcut, Ctrl+C or Dreamweaver responds by playing the copied steps. NOTE
You can't reliably copy certain actions, most notably Copy and Paste. If the actions you wish to reuse include a copy or paste step, save the actions as a command instead; read on. 19.1.4 Save Steps as CommandsIt's quick and easy to replay and copy steps to automate repetitive tasks, but if you close the document or quit Dreamweaver, your recorded actions disappear梐nd with them, any chance you had of replaying them in the future. What if you come up with a great sequence of steps that you'd like to use over and over again?
The solution: Before it disappears forever, turn it into a custom command. That way, Dreamweaver adds your command to the bottom of the Commands menu, and you can choose it from there anytime. To save steps as a command, select the steps you want to copy (see "Replay Your Steps" in Section 19.1.1 for selection techniques), then click the Save Steps button (its icon looks like a little floppy disk) on the History panel. The Save as Command dialog box pops open. (If you've selected steps that Dreamweaver can't replay, such as mouse movements, a warning appears. Click Yes to continue without those steps; the valid steps will work just fine.) Type a short, descriptive name and click OK. Now take a look at the Commands menu梥ure enough, your command now appears at the bottom. To use your custom command, simply select its name from the Commands menu.
19.1.5 Recording CommandsYou can also create a command by telling Dreamweaver to watch and record your actions. This time, Dreamweaver won't let you perform mouse movements while you're recording, so you can be sure recorded commands will play back properly. To record a command, make sure the relevant Web page document is frontmost,
then choose Commands When you're finished, choose Commands Note, however, that this command disappears when you quit Dreamweaver or record another command. (Dreamweaver can only save one recorded command at a time.) If you want to preserve it for posterity, you'll have to save it to the Commands menu, like this:
|
![]() |
< Day Day Up > |
![]() |