macro to strip out (delete) all footnotes

Get help using and writing Nisus Writer Pro macros.
Post Reply
NisusUser
Posts: 258
Joined: 2011-01-12 05:32:38

macro to strip out (delete) all footnotes

Post by NisusUser » 2013-03-01 01:08:44

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.

User avatar
phspaelti
Posts: 943
Joined: 2007-02-07 00:58:12
Location: Japan

Re: macro to strip out (delete) all footnotes

Post by phspaelti » 2013-03-01 02:34:14

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

NisusUser
Posts: 258
Joined: 2011-01-12 05:32:38

Re: macro to strip out (delete) all footnotes

Post by NisusUser » 2013-03-01 06:10:43

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.

User avatar
phspaelti
Posts: 943
Joined: 2007-02-07 00:58:12
Location: Japan

Re: macro to strip out (delete) all footnotes

Post by phspaelti » 2013-03-01 06:53:30

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.
philip

User avatar
phspaelti
Posts: 943
Joined: 2007-02-07 00:58:12
Location: Japan

Re: macro to strip out (delete) all footnotes

Post by phspaelti » 2013-03-01 07:01:41

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.
philip

User avatar
phspaelti
Posts: 943
Joined: 2007-02-07 00:58:12
Location: Japan

Re: macro to strip out (delete) all footnotes

Post by phspaelti » 2013-03-01 07:15:03

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.
philip

NisusUser
Posts: 258
Joined: 2011-01-12 05:32:38

Re: macro to strip out (delete) all footnotes

Post by NisusUser » 2013-03-01 07:16:37

And silly me! I had no idea I could do that. But it works! Thanks!! Case closed. :)
Last edited by NisusUser on 2013-03-03 21:33:43, edited 1 time in total.

User avatar
phspaelti
Posts: 943
Joined: 2007-02-07 00:58:12
Location: Japan

Re: macro to strip out (delete) all footnotes

Post by phspaelti » 2013-03-01 07:34:05

As for a macro the following works:

Code: Select all

while Select Next Note Reference
	Cut
end
philip

User avatar
martin
Official Nisus Person
Posts: 4358
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: macro to strip out (delete) all footnotes

Post by martin » 2013-03-05 12:25:18

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: Select all

$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

Post Reply