Count footnotes?
Posted: 2014-12-25 21:11:06
Does anyone know if there is a way to count the number of footnotes in a document, please?
Here is a macro that will count the number of footnotes in your document.PostGradDad wrote:Does anyone know if there is a way to count the number of footnotes in a document, please?
Code: Select all
### How many footnotes are in my document? ###
# Based on the macro "Select Note References in Body" (by Kino?)
Require Application Version 3.1
$doc = Document.active
if $doc == undefined
exit
end
$notes = $doc.allNotes
if ! $notes.count
Exit 'No note found, exit...'
end
$text = $doc.text
$noteRefsInBody = Array.new
$count = 0
foreach $note in $notes
$count = $count+1
end
If $count >1
$texti1 = "In your document are "
$texti2 = " footnotes."
else
$texti1 = "In your document is "
$texti2 = " footnote."
end
$count = $count & $texti2
Prompt $texti1 & $count
### end of macro ###Code: Select all
$doc = Document.active
prompt $doc.allNotes.count
This is really nice. Thank you, Philip. Where would we be without you?phspaelti wrote:all the information required is contained in the single variable $doc.allNotes.count