316
1. Choose Advanced >
Document Processing >
Set Document Actions.
The Document Actions
dialog opens, showing a
list of actions that refer
to different states of a
document.
2. Select an action from
the list at the left of the
dialog. Then click Edit to
open the JavaScript
Editor dialog.
3. Type the text for your
script in the JavaScript
Editor dialog.
4. Click OK to close the dia-
log and list the script in
the Document Actions
dialog—the selected
action shows a green
circle next to its listing,
meaning it has an active
script.
5. Click OK to close the
Document Actions
dialog.
6. Save the document. To
test the script, close the
document or print it,
depending on the
chosen action.
C h a p t e r f i f t e e n
As you can see, there are many menu commands you can attach to your
buttons and links.
Keep these tips in mind:
•
When you are editing link actions, click the action itself, not the details
(such as a filename) that are listed for some actions.
•
If you are editing a button action, click the action itself, not the trigger
or the details—remember, only buttons have triggers.
•
You don't have to plan a sequence of actions ahead of time. Add the
actions you want to use and then select an action you want to reorder,
and click Up or Down to move it in the execution list.
•
If you change your mind about using an action, select it in the Actions
area of the dialog and click Delete.
Note
You can also add actions to the entire document. Read about document
actions in the sidebars "Making Your Document Responsive" and "Get in
a State."
Get in a State
Documents have five scriptable states, including the following:
•
Document Will Close (when a document closes)
•
Document Will Save (before a document is saved)
•
Document Did Save (after a document is saved)
•
Document Will Print (before a document is printed)
•
Document Did Print (after a document is printed)
Take note of the different states. For example, an action used in the Document
Will Save state takes place before the document is saved, whereas the
Document Did Save action occurs after the document is saved.
Scripting Assistance
There are many resources available to help you learn how to write JavaScript,
including the form of JavaScript used in Acrobat. For example, check out the
Adobe JavaScript Scripting Guide available at http://www.adobe.com/devnet/
acrobat/javascript.html.
Controlling Action and Interaction
From the Library of Daniel Dadian
Need help?
Do you have a question about the ACROBAT 9 HOW-TOS and is the answer not in the manual?
Questions and answers