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

Help! app.alert box not working in acrobat 8

adexdesigner03
Registered: Sep 9 2010
Posts: 1
Answered

I want a simple dialog box to pop up with a message when my pdf opens. I am using acrobat 8 pro. I'm new to javascript in acrobat. I've added the following under Advanced>Document Processing>Document Javascripts:

function documentopen()
{
app.alert('Attention','You must print, complete, and obtain proper signatures on both copies of this form.',3);
}

After saving and reopening the pdf the box does not appear. Please help!

My Product Information:
Acrobat Pro 8.0, Macintosh
Zhe Toralf
Registered: Sep 6 2010
Posts: 3
Try this one:

"var dialog =
{
description:
{
name: "Your caption here",
align_children: "align_left",
width: 200,
height: 80,
elements:
[
{
type: "static_text",
name: "Your message here."
},
{
alignment: "align_right",
type: "ok",
ok_name: "OK",
}
]
}
};

app.execDialog(dialog);"

I copied it from one of my scripts so you might want to adjust the size and alignment.
Also, if you are new and need help, you should try this:
http://www.adobe.com/devnet/acrobat/pdfs/js_api_reference.pdf

so long...
UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
Document-level functions aren't run unless something calls them. Just put the single line

app.alert('Attention','You must print, complete, and obtain proper signatures on both copies of this form.',3);

in the document-level script, and remove the wrapper turning it into a function.