Document JavaScript

The JavaScipt tab in document properties allow you to view and edit a document's JavaScript actions. These are actions that occur at the document level based on certain events. These events can be on open, close, before saving, after saving, before printing, and after printing. Actions can be added, edited, or deleted using the options in this tab.

How to View/Edit the Document JavaScript Actions

  1. Go to File > Document Properties from the menu or using the shortcut keys Ctrl + D (Cmd + D on Mac).
  2. Click on the JavaScript Tab
  3. The current actions will be displayed in the dialog. Use the Add, Edit, or Remove options to modify the JavaScript actions if needed
  4. Click OK to apply the changes
  5. Save the document to save the new Document JavaScript settings

Options

Add - Opens the action dialog to add an action to the document

Edit - Edits the currently selected action from the list

Remove -  Removes the currently selected action from the list

Document Actions

Event

Open: Open actions will be triggered when the document is opened

Close: Close actions will be triggered when the document is closed

Before Save: Before save actions will be triggered when the document is saved but before the file on the system is actually updated. For example, if you wanted to update a date value with the exact time saved

After Save: After save actions will be triggered once the file has been saved

Before Print: Before print actions will be triggered when the document is printed but before the file is actually sent to the printer. For example, if you wanted to update a date value with the exact time printed

After Print: After print actions will be triggered after the document is printed

JavaScript Action

Sets the Document Action to perform a custom Supported JavaScript action that can be typed into the field. Type the JavaScript you wish to be used into the text box.