I’ve done that job for you. Download the script addDocumentScripts.js and save it on your local computer.
This will bring up the following dialog:
First select what type of script you want to add (the default is “Document Level”):
- Document Level Script
- Document Action:
- Will Close
- Will Save
- Did Save
- Will Print
- Did Print
The script name is only necessary for a document level script, the document actions do not require a name (there can only be one per type).
When you fill in the script, make sure you paste from your text editor: Edit the script in an editor and then just paste the final script, do not edit the script in this dialog. The reason for this is that you will not be able to retrieve the script with Acrobat Standard, only Acrobat Pro allows you to do that. This means that any changes you make to your script in the input field on this dialog will be lost – they will be saved in the document, but you will not be able to retrieve or to edit them.
This is not the most elegant way to add scripts to a document, but if all you have is Acrobat Standard, at least you can.