Inserting footnotes back into the text flow with and adding a different formatting

New Here ,
Sep 09, 2020 Sep 09, 2020

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

TOPICS
Scripting, Type

Views

353

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advisor , Sep 10, 2020 Sep 10, 2020
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]" ) ...

Likes

Translate

Translate
Adobe Community Professional ,
Sep 09, 2020 Sep 09, 2020

Copy link to clipboard

Copied

To insert a footnote into the text:

  1. Copy the footnote text
  2. Type > Insert Footnote
  3. Type the text or use Edit > Paste or Edit > Paste Unformatted 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 

 

note.gif

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 09, 2020 Sep 09, 2020

Copy link to clipboard

Copied

thanks!

that would help for a few footnotes, I am talking about a document with
hundreds of footnotes that I want to move them back to the text flow, and
just change their style.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Sep 09, 2020 Sep 09, 2020

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 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Sep 09, 2020 Sep 09, 2020

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:

Screen Shot 2020-09-09 at 11.47.36 AM.png

 

~Barb 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 09, 2020 Sep 09, 2020

Copy link to clipboard

Copied

sorry for not explaining my problem correctly.

What I need to do is take all footnotes from a given document and move them
back into the main text flow (it should be as regular text not as footnotes
- move the footnotes into the story).

thanks

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Sep 09, 2020 Sep 09, 2020

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Sep 10, 2020 Sep 10, 2020

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]" )

    }

 

(^/)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2020 Sep 11, 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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Sep 14, 2020 Sep 14, 2020

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!

 

(^/) 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Sep 15, 2020 Sep 15, 2020

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!  😉 ]

 

(^/)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 16, 2021 Jun 16, 2021

Copy link to clipboard

Copied

LATEST

It beautifully processes all notes. But how to do when you only have to move only one, and that is not cutting and pasting?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Sep 09, 2020 Sep 09, 2020

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Sep 09, 2020 Sep 09, 2020

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Sep 11, 2020 Sep 11, 2020

Copy link to clipboard

Copied

Couldn't you understand this code?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2020 Sep 11, 2020

Copy link to clipboard

Copied

thanks, I actually tried it and it works, but michel's works faster

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 10, 2020 Sep 10, 2020

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2020 Sep 11, 2020

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines