Copy link to clipboard
Copied
I launch one dialog using app.execDialog(dialog1). Then in that dialog I have a button and if they click the button I dismiss the current dialog using:
"btn1": function(dialog) {
dialog.end();
app.execDialog(dialog2);
}
This works fine in Adobe Acrobat Pro DC on Mac, but on Windows it does not dismiss the original dialog. Any ideas?
The code is incompatible. There is only one active dialog at a time, that's want being modal is about. There can only be one!! And this code is trying to start a new one before old one is gone. I'm surprised Acrobat behaved so well and didn't crash.
And you have another issue. the end function requires a string input. This is the value returned by the app.execDialog function.
Copy link to clipboard
Copied
If I take out this line:
app.execDialog(dialog2);
then the dialog.end() works.
So why does opening a new dialog after dismissing the existing dialog prevent the existing dialog from getting dismissed?
Copy link to clipboard
Copied
The code is incompatible. There is only one active dialog at a time, that's want being modal is about. There can only be one!! And this code is trying to start a new one before old one is gone. I'm surprised Acrobat behaved so well and didn't crash.
And you have another issue. the end function requires a string input. This is the value returned by the app.execDialog function.
Copy link to clipboard
Copied
Ahh thank you very much! That solved the problem.
Copy link to clipboard
Copied
The way to do it is to return a specific value back to the main thread when the dialog is closed, and then check that value and if necessary open a new dialog window right away.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now