fix: remplacer popUpMenu par app.alert, retirer event.target
app.popUpMenu ne fonctionne pas depuis un menu item dans Acrobat 2026. Remplacement par app.alert Oui/Non/Annuler pour le module Livret. Tous les cExec passent doc=undefined, getDocActif() recupere app.activeDocs[0] automatiquement. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -241,7 +241,7 @@ try {
|
||||
cName: "CDImpLivret",
|
||||
cUser: "Livret / Delivretiser",
|
||||
cParent: "ImpositionPro",
|
||||
cExec: "try{app.alert('Livret: lancement...');CDImp.Livret.lancer(event.target);}catch(e){app.alert('Erreur: '+e);}",
|
||||
cExec: "try{CDImp.Livret.lancer();}catch(e){app.alert('Erreur: '+e);}",
|
||||
cEnable: "event.rc = true;",
|
||||
nPos: 0
|
||||
});
|
||||
@@ -251,7 +251,7 @@ try {
|
||||
cName: "CDImpNUp",
|
||||
cUser: "N-Up / Step and Repeat",
|
||||
cParent: "ImpositionPro",
|
||||
cExec: "if(CDImp.NUp&&CDImp.NUp.lancer)CDImp.NUp.lancer(event.target);",
|
||||
cExec: "if(CDImp.NUp&&CDImp.NUp.lancer)CDImp.NUp.lancer();",
|
||||
cEnable: "event.rc = true;",
|
||||
nPos: 1
|
||||
});
|
||||
@@ -261,7 +261,7 @@ try {
|
||||
cName: "CDImpDecoupe",
|
||||
cUser: "Decoupe et reassemblage",
|
||||
cParent: "ImpositionPro",
|
||||
cExec: "if(CDImp.Decoupe&&CDImp.Decoupe.lancer)CDImp.Decoupe.lancer(event.target);",
|
||||
cExec: "if(CDImp.Decoupe&&CDImp.Decoupe.lancer)CDImp.Decoupe.lancer();",
|
||||
cEnable: "event.rc = true;",
|
||||
nPos: 2
|
||||
});
|
||||
@@ -271,7 +271,7 @@ try {
|
||||
cName: "CDImpMarges",
|
||||
cUser: "Marges et cadrages",
|
||||
cParent: "ImpositionPro",
|
||||
cExec: "if(CDImp.Marges&&CDImp.Marges.lancer)CDImp.Marges.lancer(event.target);",
|
||||
cExec: "if(CDImp.Marges&&CDImp.Marges.lancer)CDImp.Marges.lancer();",
|
||||
cEnable: "event.rc = true;",
|
||||
nPos: 3
|
||||
});
|
||||
@@ -281,7 +281,7 @@ try {
|
||||
cName: "CDImpReperes",
|
||||
cUser: "Reperes et numerotation",
|
||||
cParent: "ImpositionPro",
|
||||
cExec: "if(CDImp.Reperes&&CDImp.Reperes.lancer)CDImp.Reperes.lancer(event.target);",
|
||||
cExec: "if(CDImp.Reperes&&CDImp.Reperes.lancer)CDImp.Reperes.lancer();",
|
||||
cEnable: "event.rc = true;",
|
||||
nPos: 4
|
||||
});
|
||||
@@ -291,7 +291,7 @@ try {
|
||||
cName: "CDImpAuto",
|
||||
cUser: "Automatisation",
|
||||
cParent: "ImpositionPro",
|
||||
cExec: "if(CDImp.Auto&&CDImp.Auto.lancer)CDImp.Auto.lancer(event.target);",
|
||||
cExec: "if(CDImp.Auto&&CDImp.Auto.lancer)CDImp.Auto.lancer();",
|
||||
cEnable: "event.rc = true;",
|
||||
nPos: 5
|
||||
});
|
||||
|
||||
@@ -243,19 +243,22 @@ CDImp.Livret.lancer = function (doc) {
|
||||
try {
|
||||
doc = CDImp.Util.getDocActif(doc);
|
||||
} catch (e) {
|
||||
CDImp.Util.erreur(e.toString());
|
||||
app.alert("Veuillez ouvrir un document PDF avant de lancer l'imposition.");
|
||||
return;
|
||||
}
|
||||
|
||||
var sens = app.popUpMenu(
|
||||
{ cName: "Creer un livret (imposition)", cReturn: "imposer" },
|
||||
{ cName: "Delivretiser (revenir a l'ordre de lecture)", cReturn: "delivretiser" }
|
||||
);
|
||||
if (!sens) {
|
||||
return; // annulation
|
||||
var choix = app.alert({
|
||||
cMsg: "Que souhaitez-vous faire ?\n\nOui = Creer un livret (imposition)\nNon = Delivretiser (revenir a l'ordre de lecture)",
|
||||
cTitle: "Livret / Delivretiser",
|
||||
nIcon: 2,
|
||||
nType: 3
|
||||
});
|
||||
// 4=Oui, 3=Non, 2=Annuler
|
||||
if (choix === 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (sens === "delivretiser") {
|
||||
if (choix === 3) {
|
||||
CDImp.Livret.delivretiser(doc);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user