Reply To: Alert message before exporting PDF

#114026
Masood Ahmad
Participant

We further refine the script. The only problem I can see is that it either runs successfully on one system and only run once on another system. While troubleshooting, I noticed that if a user selects “Yes”, then the script don’t run the second time.

Can anyone help me improve the script. Thanks in advance.


#targetengine "inDesign"

app.addEventListener("beforeClose", onClose);

function onClose(e) {

var result = confirm('Have you run the Spell-Check?', true, "WARNING");

if (result == true) {
app.eventListeners.everyItem().remove();
return
}

else(result == false) {
e.stopPropagation();
e.preventDefault();
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;
app.menuActions.item("Check Spelling...").invoke();
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
}
}

This article was last modified on January 30, 2019

Comments (0)

Loading comments...