These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Document Level Javascript

wdrspens
Registered: Jul 22 2008
Posts: 94

When designing Forms -

Can I enter Document Level Javascript using Adobe Acrobat 9 Standard?

I cannot locate it on the toolbar - am I missing something?

Thanks

David

My Product Information:
Acrobat Standard 9.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
I don't have Acrobat 9 Standard, but in Pro, the menu item is "Advanced > Document Processing > Document JavaScripts". They change it every time.George
wdrspens
Registered: Jul 22 2008
Posts: 94
Thanks George. However in Standard that item is not awailable which is why I asked the question. There is a 'Document Action' on the same 'Advanced' menu, but it only gives the ability to execute a JavaScript when the Document is being closed, saved or printed, which does not assist me.
I think I will have to upgrade to Pro.
Again, many thanks,
David
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
First, you will need to open the JavaScript debugging console and then you should be able use this console interactively to add a document level script using the "addScript(cName, cSript)" method of the doc object. See the following example from the version 8 JS API.

Example
Create a beeping sound every time the document is opened.

this.addScript("My Code", "app.beep(0);");

A trick that can be used to open the JS console in Standard is to create a bookmark with the following JavaScript action:

console.show();

One could also add a menu option or tool bar button to perform the same action by creating a folder level JavaScript to add the action..

George Kaiser

wdrspens
Registered: Jul 22 2008
Posts: 94
You are streets ahead of me.

How do I create a bookmark with the JavaScript action:
console.show()

Alternatively, how do I add a menu option to perform the same action by creating a folder level JavaScript to add the action?

I am sorry, but my hand needs holding in this area, as I have a lot to learn.

Thanks for the suggestions, anyway.

David