Footnotes. Adobe InCopy CS6

Add to My manuals
105 Pages

advertisement

Footnotes. Adobe InCopy CS6 | Manualzz

Text and Type Footnotes 59

Footnotes

The following script fragment shows how to add footnotes to a story (for the complete script, see

Footnotes): var myWord, myFootnote; var myDocument = app.documents.item(0); var myStory = myDocument.stories.item(0);

//Add four footnotes at random locations in the story.

for(myCounter = 0; myCounter < 4; myCounter ++){ myWord = myStory.words.item(myGetRandom(0, myStory.words.length)); var myFootnote = myWord.insertionPoints.item(-1).footnotes.add();

//Note: when you create a footnote, it contains text--the footnote

//marker and the separator text (if any). If you try to set the text of

//the footnote by setting the footnote contents, you will delete the

//marker. Instead, append the footnote text, as shown below.

myFootnote.insertionPoints.item(-1).contents = "This is a footnote.";

//This function gets a random number in the range myStart to myEnd.

function myGetRandom(myStart, myEnd){ var myRange = myEnd - myStart; return myStart + Math.floor(Math.random()*myRange);

}

advertisement

Related manuals

Download PDF

advertisement

Table of contents