nisus.com
https://www.nisus.com/forum/

macro to strip out (delete) all footnotes
https://www.nisus.com/forum/viewtopic.php?f=17&t=5270
Page 1 of 1

Author:  NisusUser [ 2013-03-01 01:08:44 ]
Post subject:  macro to strip out (delete) all footnotes

How would I go about making a macro to delete all footnotes? I want the markers in the main text gone and the associated text at the bottom of the page. Probably I should have one for endnotes, too, or just one that does both.

Thanks.

Author:  phspaelti [ 2013-03-01 02:34:14 ]
Post subject:  Re: macro to strip out (delete) all footnotes

My version of Nisus comes with a pre-installed macro in the macro menu: "NoteConversions > Convert Footnotes to Inline Snippets"

Author:  NisusUser [ 2013-03-01 06:10:43 ]
Post subject:  Re: macro to strip out (delete) all footnotes

phspaelti wrote:
My version of Nisus comes with a pre-installed macro in the macro menu: "NoteConversions > Convert Footnotes to Inline Snippets"


Well, Philip, mine apparently didn't. Under "Editing" in Macros I have "Convert Notes to text", but that's not what I want. I just want to totally eradicate them.

Author:  phspaelti [ 2013-03-01 06:53:30 ]
Post subject:  Re: macro to strip out (delete) all footnotes

Sorry, I misread what you wanted. If you want to remove the notes completely that is very easy. Put a Note marker in the find window, and nothing in the Replace box. Press (not hit :wink: [Martin] ) "Replace All" and they'll be gone.

Author:  phspaelti [ 2013-03-01 07:01:41 ]
Post subject:  Re: macro to strip out (delete) all footnotes

Sorry I spoke too soon! You can tell I work with Footnotes only once in a blue moon. I was pretty sure this method worked once. Right now I can't see how one gets a footnote marker into the Find window. Obviously this could be done with a macro, but I thought there was a simpler way.

Author:  phspaelti [ 2013-03-01 07:15:03 ]
Post subject:  Re: macro to strip out (delete) all footnotes

Well silly me. The easiest way to strip all footnotes, is to select one, use Select All (i.e. <command>-A) and then just delete. You will get a warning prompt, before it removes them.

But if you still want a macro, one can be provided.

Author:  NisusUser [ 2013-03-01 07:16:37 ]
Post subject:  Re: macro to strip out (delete) all footnotes

And silly me! I had no idea I could do that. But it works! Thanks!! Case closed. :)

Author:  phspaelti [ 2013-03-01 07:34:05 ]
Post subject:  Re: macro to strip out (delete) all footnotes

As for a macro the following works:

Code:
while Select Next Note Reference
   Cut
end

Author:  martin [ 2013-03-05 12:25:18 ]
Post subject:  Re: macro to strip out (delete) all footnotes

Thanks for all that help Philip. I think just placing the selection into any footnote/endnote area, using Select All, and then pressing delete is the easiest way to go.

In case it's useful, here's another macro that asks you which type of notes you want to delete, all footnotes or endnotes:
Code:
$type = Prompt 'Delete all notes of what type?', 'Deleting endnotes will delete both section endnotes and document endnotes.', 'Footnotes', 'Endnotes'
If 'Footnotes' == $type
   $isDeleteFootnotes = true
Else
   $isDeleteFootnotes = false
End


Select Document Start
While Select Next Note Reference
   $selected = TextSelection.active
   $note = $selected.text.noteAtIndex($selected.location)
   $isFootnote = $note.placement == 'page'
   If $isFootnote == $isDeleteFootnotes
      Delete
   End
End

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/