InDesign is usually pretty well-behaved about applying the specified paragraph style to footnotes in a document.
By “well-behaved,” I mean that InDesign seems to respect the setting in the Footnote Options dialog that specifies the paragraph style to use for footnotes.
But sometimes I have noticed, when importing text from Word, that this setting is not respected. There are other times, too, when some footnotes seem not to have the correct paragraph style applied to them. I’m not sure I’ve spotted a consistent pattern as to when this happens.
But clearly, when it happens, and some footnotes do not have the required “footnote” paragraph style applied to them, this needs to be fixed.
The thing is, because it is not possible to select all footnotes in InDesign, it is surprisingly difficult to do anything to all footnotes in bulk, including apply a paragraph style to them.
The following one-line script solves the particular problem of applying a style to all footnotes in the document. (It’s a long line! So make sure to copy everything and save as a .jsx in your Script panel folder.)
document.stories.everyItem().footnotes.everyItem().texts.everyItem().applyParagraphStyle(app.selection[0].appliedParagraphStyle, true);
To use, do the following:
- Apply the desired paragraph style to a footnote in the document.
- Make sure your text cursor is placed somewhere in that footnote.
- Run the script.
The script checks what paragraph style is applied to the paragraph under the cursor, and applies this paragraph style to all footnotes in the document.
Important note:ย The scriptย removes all local text overrides in the footnotes. So if you need to preserve things like bold or italics, make sure to first apply a character style to them to make them non-local. There are many ways to do this, not least of which is our very own Auto Character Styles!
Hope you find this little one-liner useful!
Sander Pinkse
May 3, 2018 3:12 pmNow that is very helpful. Thanks a lot!
Renato Oliveira
June 4, 2018 7:49 amThanks!! This is extremely helpful!!
Y.W
January 20, 2019 4:41 pmHey there, I’m trying to use the Script but i keep getting error message number 8 about Syntax Error – any idea what i might be doing wrong?
Many thanks,
Yoav
Ariel
January 26, 2019 11:34 pmHi Yoav,
It’s probably that you didn’t copy the script properly. Make sure to copy the entire line โ it’s a long line, so you’ll have to scroll to copy it all. Then save that in a plain text editor (not Word!) with a .jsx extension and it should work.
eliyah
July 23, 2020 11:45 amhi, had the same issue, then i made the file plain text (it overrides the extension, so you nee to rewrite the extension as .jsx after you u make it plain text and it works. Thanks Ariel!
Atiq
May 10, 2019 11:36 pmvery much helpful. great. 1000 of footnotes styles changed in a few seconds. thank you very much
Ariel
May 15, 2019 8:34 pmGreat, glad it worked for you, and thanks for posting feedback!
marcin
August 31, 2019 3:13 pmThank you Ariel for alternative clue to my problem :). Described problems with texts from Word I met nearly every time. I’ve tried to do removeOverrides() to nearly every object of footnote, but always my function returned invalid object during iteration. I completly don’t know why :(. I suspect the number of a footnote is a problem here, becouse property โcontentsโ returns all the content of footnote without number and folowing white space. Your solution as obvious as elegant ๐ thank you again!
Ne Lynn Aung
September 22, 2020 6:32 pmThanks for the script. It solved the problem. Appreciate!
Ariel
October 20, 2020 1:54 amYou’re welcome!
profeivan
March 14, 2022 10:53 pmAs always, a wonderful and a “simple” solution. Works great. Thank you Ariel
Ariel
March 14, 2022 11:10 pmThank you, Profesor!
Rebecca Zins
October 11, 2022 8:51 pmI’m using InDesign 2021 and cannot get this script to work; I get an error message saying that it won’t run. I have a document with hundreds of footnotes and would love a solution in script format. Thank you!
Ariel
October 11, 2022 9:03 pmNo reason it shouldn’t run in 2021.
What is the exact error message you’re getting?
Andrew
November 22, 2022 5:44 amHi there, I’m getting the same problem.
It’s saying “the file is not executable by any support script language” ๐
Ariel
November 22, 2022 11:06 pmAs the post says: “Make sure to copy everything and save as a .jsx in your Script panel folder”. You should use Notepad or a similar text editor, and not a wordprocessor like Word.
JC
March 21, 2023 5:04 pmThanks for this!
An alternative without using a script that works for me is the following:
Go to Find/Change (Make sure Search> Document is selected).
Then select under Find Format and Change Format the paragraph style that you have created for your footnotes i.e. “Footnotes style 1”.
Finally click on Change All.
So basically you are replacing the paragraph Style “Footnotes sytle 1” with the exact same paragraph style.
This somehow refreshes the footnotes in the entire document and cleans all the overrides.
Let me know if it works!