fix: remplacer app.alert nType:3 par app.response pour Livret

Les alertes multiples sont bloquees dans Acrobat 2026 depuis un
cExec menu. app.response avec saisie I/D fonctionne comme premiere
et unique interaction modale.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jules Dubois
2026-06-25 18:58:48 +02:00
parent 2dfa85ad3b
commit fd44f77dc1

View File

@@ -240,29 +240,27 @@ CDImp.Livret.delivretiser = function (doc) {
// Point d'entree du module (appele depuis le panneau principal, Module 1) // Point d'entree du module (appele depuis le panneau principal, Module 1)
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
CDImp.Livret.lancer = function (doc) { CDImp.Livret.lancer = function (doc) {
app.alert("DEBUG 1: entree dans lancer");
try { try {
doc = CDImp.Util.getDocActif(doc); doc = CDImp.Util.getDocActif(doc);
} catch (e) { } catch (e) {
app.alert("DEBUG: pas de doc - " + e); app.alert("Veuillez ouvrir un document PDF.");
return; return;
} }
app.alert("DEBUG 2: doc ok, numPages=" + doc.numPages);
var choix = app.alert({ var choix = app.response({
cMsg: "Que souhaitez-vous faire ?\n\nOui = Creer un livret (imposition)\nNon = Delivretiser (revenir a l'ordre de lecture)", cQuestion: "Tapez I pour Imposer (creer un livret)\nou D pour Delivretiser (revenir a l'ordre de lecture) :",
cTitle: "Livret / Delivretiser", cTitle: "Livret / Delivretiser",
nIcon: 2, cDefault: "I"
nType: 3
}); });
app.alert("DEBUG 3: choix=" + choix); if (!choix) return;
// 4=Oui, 3=Non, 2=Annuler choix = choix.toUpperCase();
if (choix === 2) {
if (choix === "D") {
CDImp.Livret.delivretiser(doc);
return; return;
} }
if (choix !== "I") {
if (choix === 3) { app.alert("Choix non reconnu. Tapez I ou D.");
CDImp.Livret.delivretiser(doc);
return; return;
} }