• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Find/replace and converting footnotes/endnotes

Participant ,
Dec 19, 2024 Dec 19, 2024

Copy link to clipboard

Copied

Hello,

 

The latest versions of InDesign CC have the functionality for converting endnotes to footnotes or vice versa. This conversion can be for all notes in the document or select notes.

 

My question is whether specific notes can be found in the document based on formatting (e.g. with a GREP search) and then the found note is converted.

 

Consider the following footnotes in a document...

 

1. Bla bla note one.

2. [Lorem ipsum note two.]

3. Bla bla bla bla another note here.

4. [Eeny meeny miny mo.]

5. Ip dip do the cat has the flu.

 

So, I want to find the footnotes in square brackets. I know I can do this with a Grep search which would be something like:

 

Find:  ~F\t\[.+\]

Find format - Paragraph style: Footnote paragraph

 

The question is whether it is possible to covert the found text into an endnote other than manually through the right click options or TYPE > CONVERT FOOTNOTES AND ENDNOTES options.

 

Does this require a script or can it be done through Find/Replace?

 

If only there ws a way to select all of the required footnotes then the menu option could be used to convert them to endnotes. This would also work.

TOPICS
How to , Scripting

Views

228

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
Community Expert ,
Dec 19, 2024 Dec 19, 2024

Copy link to clipboard

Copied

Does this require a script or can it be done through Find/Replace?

 

Yes, this requires a script, it can't be done in the interface.

Votes

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
Community Expert ,
Dec 21, 2024 Dec 21, 2024

Copy link to clipboard

Copied

Here is the whole process - based on the file provided by A2D2 -- which shows, that ID-Tasker is perfectly fine with RTL texts as well.

 

THIS IS VERY IMPORTANT - Endnotes option NEEDS to be set to "On a New Page":

RobertatIDTasker_5-1734790970311.png

Otherwise, it will create bunch of separate TextFrames for each Endnote.

 

Let's load Footnotes in "( )":

RobertatIDTasker_6-1734790997315.png

As per screenshot - Arabic text is displayed in the IDT's UI as well.

 

I want to convert only those 3x selected:

RobertatIDTasker_7-1734791078396.png

 

After conversion - references are doubled:

RobertatIDTasker_8-1734791142220.png

 

And fixed: 

RobertatIDTasker_9-1734791287714.png

 

 

Now, what's left, is to test IDT on some Far East document.

 

Even the free version of ID-Tasker can do the whole process semi-automatically - each Footnote that needs conversion, has to be pre-selected - double-clicked on the list of the found results - which BatchMode do this automatically in the full / paid version. 

 

Votes

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
Guide ,
Dec 21, 2024 Dec 21, 2024

Copy link to clipboard

Copied

Quickly [because of Christmas], Script written for a client in june 2021!  😉

 

https://youtu.be/WKLzitQa4Mw

https://youtu.be/mq5ZLL6O8AE

 

 

(^/)  The Jedi

Votes

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
Community Expert ,
Dec 21, 2024 Dec 21, 2024

Copy link to clipboard

Copied

@FRIdNGE

 

Is it all or nothing? 

 

The ones with "ref" in the body? 

 

Votes

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
Guide ,
Dec 21, 2024 Dec 21, 2024

Copy link to clipboard

Copied

Exactly what the op would like basing on a Grep F/R!  😉

 

(^/)

Votes

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
Participant ,
Dec 23, 2024 Dec 23, 2024

Copy link to clipboard

Copied

Thank you, and I am glad to see you dealt with this 3 years ago ... but you give no clues about the script! Would you consider sharing or at least describing? 🙂

Votes

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
Community Expert ,
Dec 23, 2024 Dec 23, 2024

Copy link to clipboard

Copied

Sorry to be a spoilsport, but this is so simple there's no reason to be mysterious about it.

 

To use the script, test whether your search string finds all and only what you're looking for, then run it.

 

(function () {

  var start = app.activeDocument.footnoteOptions.separatorText.length+1;

  function footnoteToEndnote (fnote) {
    var endnote = fnote.storyOffset.createEndnote();
    
    fnote.texts[0].characters.itemByRange (start, -1).
      move (
        LocationOptions.AFTER, 
        endnote.insertionPoints[-1]
      );
    
    fnote.remove();
  }

  var fn = app.activeDocument.findGrep();
  for (var i = fn.length-1; i >= 0; i--) {
    footnoteToEndnote (fn[i].parent);
  }

}());

 

 

Votes

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
Participant ,
Dec 23, 2024 Dec 23, 2024

Copy link to clipboard

Copied

Thank you @Peter Kahrel , worked for me in CC2025.

 

But raises the questions as to whether your pre-CC2018 footnote to endnote script could be modified to convert SELECT FOOTNOTES BASED ON GREP MATCH ONLY, rather than coverting ALL footnotes.

 

I did take a look at the script but couldn't figure it out myself.

Votes

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
Community Expert ,
Dec 23, 2024 Dec 23, 2024

Copy link to clipboard

Copied

You didn't mention pre-CC2018. Doing endnotes from search results in pre-2018 InDesign is no trivial matter. Better upgrade to ID 2024 or 2025.

Votes

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
Guide ,
Dec 23, 2024 Dec 23, 2024

Copy link to clipboard

Copied

Surely the reason I wrote my Script. See comments on YouTube video 2 [29/06/2021]:

 

"3 problems to be fixed:

• your document contains several stories and you have to numerate footnotes from 1 to n, on all the doc.

• you need to convert "ref." footnotes to endnotes (at the end of each current story),

• you use InDesign CC 2017 or another older version (CC 2018 introduced the "Endnotes" feature! not truly completely useful here)."

 

…But that was a long time ago!

 

(^/)

Votes

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
Community Expert ,
Dec 23, 2024 Dec 23, 2024

Copy link to clipboard

Copied

Conversion of Footnotes in CS6 - all or only selected - isn't a problem at all - renumbering neither - I can use mechanism used there: 

https://id-tasker.com/2024/05/12/mixing-auto-custom-footnotes/

 

Managing them - adding / removing - will might require adding a few new rules - definitely one that will correctly select multi-paragraph ones in the ENDnotes Story. 

 

Votes

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
Community Expert ,
19m ago 19m ago

Copy link to clipboard

Copied

LATEST

And done:

 

RobertatIDTasker_0-1735065994478.png

 

5x Tasks and Footnotes in "( )" converted to Endnotes - extracted and renumbered.

 

Votes

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