Copy link to clipboard
Copied
I have a book with hundreds of endnotes that need to be converted into footnotes. Does anyone know of a script to insert a footnote and format it? I think what would need to happen is that you would be able to copy the endnotes, one at a time, click an insertion point where the footnote reference would be and run the script to insert the text as a footnote and apply the style "footnote" to it; it would be nice if it would add a tab before the footnote number too! I can do it fairly efficiently just uting keyboard shortcuts but I could halve the time with a script.
Any advice would be greatly appreciated!
O-o-o -- the safe way to handle local overrides is to replace them with character styles (and my own preptext does this).
Try this new script; the applyParagraphStyle function has an optional argument 'override', which, when set to false, will not override locally applied formatting.
fn = app.selection[0].footnotes.add();
fn.texts[0].insertionPoints.item(-1).select();
app.paste();
// fn.texts[0].appliedParagraphStyle = "note";
fn.texts[0].applyParagraphStyle(app.activeDocument.paragraphStyles.item("no
...Copy link to clipboard
Copied
Sure. Copy (or Cut) something, and make sure there is no hard return at the end (that's real ugly, as it would add a blank line at the bottom of the note). Then go to the position where you want the footnote, then run this script:
fn = app.selection[0].footnotes.add();
fn.texts[0].insertionPoints.item(-1).select();
app.paste();
fn.texts[0].appliedParagraphStyle = "note";
[Ed.] I should probably tell you it's a Javascript, so save it with extension ".jsx".
[Ed#2] Oops. Tab should go before the note number. Okay, add this line after the last one:
fn.insertionPoints.item(0).contents = "\t";
(What's with the ugly formatting under a piece of code? Another jive-up!)
Copy link to clipboard
Copied
Thank you very much!! That works great and will save me tons of time (and I did make a shortcut to the script). The only refinement would be if it could be made to apply the style without stripping out the formatting (italics) that appear in some of the notes.
Copy link to clipboard
Copied
O-o-o -- the safe way to handle local overrides is to replace them with character styles (and my own preptext does this).
Try this new script; the applyParagraphStyle function has an optional argument 'override', which, when set to false, will not override locally applied formatting.
fn = app.selection[0].footnotes.add();
fn.texts[0].insertionPoints.item(-1).select();
app.paste();
// fn.texts[0].appliedParagraphStyle = "note";
fn.texts[0].applyParagraphStyle(app.activeDocument.paragraphStyles.item("note"),false);
fn.insertionPoints.item(0).contents = "\t";
Copy link to clipboard
Copied
Thank you again, that works perfectly.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more