Question

J'essaie de scripter InDesign en utilisant ExtendScript. Je veux que le script coupe le texte sélectionné, insérez une note de bas de page et collez le texte dans le corps de la note de bas de page. Ce que j'ai essayé:

 function makeFootnoteOfSelection(){
   var fnText = app.activeDocument.selection[0];
         // this should actually clone the selected text, not reference it, because the next statement zaps it from memory
   app.activeDocument.selection[0].remove();  // works
   var fNote = app.activeDocument.selection[0].footnotes.add();  // works, adds an empty footnote with a reference
   fNote.contents = fnText.contents;
         // this replaces the reference number, I was hoping to retain it and just add the text
         // fNote.contents += fnText.contents; also replaces the reference number
}

Pas de solution correcte

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top