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

Find/replace and converting footnotes/endnotes

Participant ,
Dec 19, 2024 Dec 19, 2024

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
583
Translate
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

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.

Translate
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

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.pngexpand image

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

 

Let's load Footnotes in "( )":

RobertatIDTasker_6-1734790997315.pngexpand image

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.pngexpand image

 

After conversion - references are doubled:

RobertatIDTasker_8-1734791142220.pngexpand image

 

And fixed: 

RobertatIDTasker_9-1734791287714.pngexpand image

 

 

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. 

 

Translate
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

Quickly [because of Christmas], Script written for a client in june 2021!  ðŸ˜‰

 

https://youtu.be/WKLzitQa4Mw

https://youtu.be/mq5ZLL6O8AE

 

 

(^/)  The Jedi

Translate
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

@FRIdNGE

 

Is it all or nothing? 

 

The ones with "ref" in the body? 

 

Translate
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

Exactly what the op would like basing on a Grep F/R!  ðŸ˜‰

 

(^/)

Translate
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

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? 🙂

Translate
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

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);
  }

}());

 

 

Translate
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

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.

Translate
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

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.

Translate
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

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!

 

(^/)

Translate
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

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. 

 

Translate
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 24, 2024 Dec 24, 2024
LATEST

And done:

 

RobertatIDTasker_0-1735065994478.pngexpand image

 

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

 

Translate
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