Copy link to clipboard
Copied
hi
is there a way to insert footnotes back into the text flow and it should only have a different para style etc.?
thanks
Today! …
/*
_FRIdNGE-0650_FootnoteToText.jsx
written by FRIdNGE, Michel Allio [10/09/2020]
*/
app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.ENTIRE_SCRIPT, "Footnote To Text! …");
function main()
{
var myDoc = app.activeDocument,
myFootnotes = myDoc.stories.everyItem().footnotes.everyItem().getElements();
if (myFootnotes.length == 0 ) {
alert( "No Footnote! … ;-)\r\rby FRIdNGE, Michel Allio [10/09/2020]" )
...
Copy link to clipboard
Copied
To insert a footnote into the text:
As for the paragraph style, you can set the style for all footnotes in Type > Document Footnote Options.
You can manually assign a different style at any time.
~Barb
Copy link to clipboard
Copied
Copy link to clipboard
Copied
If you have removed footnotes from the InDesign file, you will need to add them back in, one at a time.
If they are in the original Word document, you can re-place the Word file with the notes and they will be in the InDesign file, in the correct locations. Note that you will lose edits and formatting made since originally placing the file. If you can revert back to the version that had the notes, that might be best. (This is why we recommend incremental backups.)
To edit the footnote style, create and assign the style in Type > Document Footnote Options, then define the style attributes in the Paragraph styles panel.
~Barb
Copy link to clipboard
Copied
Wait. Did you remove the footnotes, or are they placed as endnotes at the end of the document? If that's the situation, you can use Type > Convert Footnotes and Endnotes:
~Barb
Copy link to clipboard
Copied
Copy link to clipboard
Copied
11 years ago! …
https://www.indiscripts.com/post/2009/08/restoring-the-footnotes-into-the-story_
No comment!
(^/) The Jedi
Copy link to clipboard
Copied
Today! …
/*
_FRIdNGE-0650_FootnoteToText.jsx
written by FRIdNGE, Michel Allio [10/09/2020]
*/
app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.ENTIRE_SCRIPT, "Footnote To Text! …");
function main()
{
var myDoc = app.activeDocument,
myFootnotes = myDoc.stories.everyItem().footnotes.everyItem().getElements();
if (myFootnotes.length == 0 ) {
alert( "No Footnote! … ;-)\r\rby FRIdNGE, Michel Allio [10/09/2020]" )
exit();
}
var myCondition = myDoc.conditions.item("Footnote");
if ( !myCondition.isValid ) var myCondition = myDoc.conditions.add ({name: "Footnote", indicatorMethod: ConditionIndicatorMethod.USE_HIGHLIGHT, indicatorColor: [150,250,150]});
for ( var f = myFootnotes.length-1 ; f >= 0 ; f-- ) {
var myFootnote = myFootnotes[f].convertToText();
myFootnote.texts[0].appliedConditions = [myCondition];
myFootnote.contents = " [" + myFootnote.contents + "]";
}
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "\\r";
app.findGrepPreferences.appliedConditions = [myCondition];
app.changeGrepPreferences.changeTo = " ";
myDoc.changeGrep();
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "\\[|\\]";
app.findGrepPreferences.appliedConditions = [myCondition];
app.changeGrepPreferences.appliedCharacterStyle = myDoc.characterStyles[0];
myDoc.changeGrep();
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = " (?=\\[)";
app.findGrepPreferences.appliedConditions = [myCondition];
app.changeGrepPreferences.appliedCharacterStyle = myDoc.characterStyles[0];
app.changeGrepPreferences.appliedConditions = [];
myDoc.changeGrep();
app.findGrepPreferences = app.changeGrepPreferences = null;
alert( "Done! … ;-)\r\rby FRIdNGE, Michel Allio [10/09/2020]" )
}
(^/)
Copy link to clipboard
Copied
Thanks, it works and made my work really easier I greatly appreciate it!!!
Is there a way that you can add too the script that the moved footnotes should have a own character or paragraph style?
Thanks
Copy link to clipboard
Copied
You could simply add such a line:
app.changeGrepPreferences.appliedCharacterStyle = "FRIdNGE";
in the first Find/Replace, supposing your char style name is "FRIdNGE"!
If problem, let's continue in private!
(^/)
Copy link to clipboard
Copied
Hi!
Change the loop as:
for ( var f = myFootnotes.length-1 ; f >= 0 ; f-- ) {
var myFootnote = myFootnotes[f].convertToText();
myFootnote.texts[0].appliedConditions = [myCondition];
myFootnote.texts[0].appliedCharacterStyle = "FRIdNGE"; // accessory demand! ;-)
myFootnote.contents = " [" + myFootnote.contents + "]";
}
… and, as you posted your question too on InDesignSecrets web-forum without answer (!),
https://indesignsecrets.com/topic/inserting-footnotes-back-into-text-flow-with-different-formatting
… thanks to mention someone helped you elsewhere [indicating this post link -- you could even say "Hello! …" for me to its boss David Blatner! 😉 ]
(^/)
Copy link to clipboard
Copied
It beautifully processes all notes. But how to do when you only have to move only one, and that is not cutting and pasting?
Copy link to clipboard
Copied
Perhaps this can be handled via scripting, but it is not a feature that is built into InDesign.
I'll add the scripting tag to your post so that the scripters will find it. As a heads up, they will likely charge you to create a script to accomplish this task. Otherwise, it's back to copy and paste.
~Barb
Copy link to clipboard
Copied
Hi,
You can try like this and after converting footnotes you can apply other styles or anything else.
Currently I am applying conditional text through code.
/////////////////////////////////////////////////////////////////////////////////
var myDoc = app.documents[0];
for(var s = 0; s < myDoc.stories.length; s++){
while(myDoc.stories[s].footnotes.length > 0){
var footnoteText = myDoc.stories[s].footnotes[0].convertToText();
myDoc.recompose();
if(!myDoc.conditions.item("footnotes").isValid){
var myCondition = myDoc.conditions.add();
myCondition.name = "footnotes";
}
else{
var myCondition = myDoc.conditions.item("footnotes");
}
footnoteText.texts[0].appliedConditions = myDoc.conditions.item("footnotes");
}
}
/////////////////////////////////////////////////////////////////////////////////
Best
Sunil
Copy link to clipboard
Copied
Couldn't you understand this code?
Copy link to clipboard
Copied
thanks, I actually tried it and it works, but michel's works faster
Copy link to clipboard
Copied
1. Find my script "endtofootnote" in https://community.adobe.com/t5/indesign/loosing-footnotes-when-placing-word-in-indesign/td-p/5128955... and save it as a JSX
2. At the end of your text story, type "(Endnotes)"" on a separate line.
3. Paste your note text below this.
4. Run the script.
It will verify that for every endnote there is a corresponding superscript number in the text and will warn you when it can't do that (you'll have to fix that manually). If all checks out it will move the end notes into place.
Standard disclaimers apply: as for regular notes, all need to be in the same story, and all note numbers must be in the correct order.
Copy link to clipboard
Copied
Thanks for your input.
I can't seem to understand your instructions and how it would help, (maybe it's just me not knowing too much about scripting), would you be so kind and expalin a little more so even me with no prior scripting experience would understand.
thanks in advance