Copy link to clipboard
Copied
Hi ,
I'm trying to ask the user to change his mind if he didn't really want to exit from the (Opened PDF Doc),, so i go to Document Action at (Document will close) and write the following :
var cMsg = "Are you sure you want to close ?";
cMsg += "\n\n";
cMsg += "Contiunue ? \n\n ";
var nRtn = app.alert(cMsg,2,2,"Warning ! ");
if(nRtn == 4)
{// A yes Response
// Code for doing the thing you do on a yes
this.closeDoc();
}
else if(nRtn == 3)
{ // No Response
//event.value = 0; // assume do nothing
beep
!this.closeDoc();
}
else
{ //Unknown Response
beep
!this.closeDoc();
}
But the Above Code is Closing the Document even if the user hit yes or no? ho do i change it to not close the document if the user hit (No)... thanks for any tip
The script can't abort the file close command. The only way is if the user closes the file using a button you added to it, which executes this code. But if they click the X button or File - Close or Quit, the file will close, no matter what.
Copy link to clipboard
Copied
Yes, the final code is for button only
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more