1
我試圖使用ExtendScript編寫InDesign腳本。我希望腳本剪切選定的文本,插入腳註並將文本粘貼到腳註正文中。我曾嘗試:從選定的文本生成腳註
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
}
腳本錯誤了與 「文本不能移動到現在的位置」在第三步。我認爲這是因爲腳註包含在步驟2之後的選擇中。 – 2011-02-11 06:53:07