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

Programming buttons

alex35.williamson
Registered: Nov 16 2011
Posts: 8

I have some JavaScript ready that is to be activated when the user clicks the X when wanting to close the document. (this is a btw!)
 
The dialogue basically states that if you close the document, any changes that have been made will be discarded and cannot be recovered if using Adobe Reader.
 
If the Yes button is clicked, the application will close (i've got that bit).
 
The no button, if clicked, is to cancel closing the document - i don't know how this would be written.
 
Any help appreciated!
 
P.S - If it helps, this is what i've got so far:
 
~~~~~
 
var cMsg = "Have you saved your work? Remember, if you’ve completed your timetable, quitting will discard any changes you have made to this document; this action cannot be undone.";
cMsg += "\n\nAre you sure you want to quit?";
 
var nButton = app.alert(cMsg, 1, 2, "Quit");
 
var QuitApp = this.closeDoc
 
if ( nButton == 3 ) this.Doc(); <= NOT SURE ABOUT THis
 
if ( nButton == 4 ) QuitApp();

Thanks, Alex :-D

My Product Information:
Acrobat Pro 10.1, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
It can't be done.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com