applying menu commands and importing stylesheets
Posted: 2014-01-25 06:12:30
I have never written any macros before and have tried looking through the macro reference under the help menu in NWP, but haven’t been able to find what I want. I am trying to put together a macro to do four tasks in relation to an RTF exported from Scriivener which has endnotes. Scrivener exports the endnotes at the end of the entire document with the index number followed by a “.” and a space; I want the endnotes to be placed at the end of the relevant sections with a hanging indent and a tab separating the index from the note text. A further point about the exported file is that Scrivener doesn’t currently have styles, but the endnotes are recognised by NWP as endnotes and are given a zero-style marker (if I can put it that way) which must be removed, which I do currently using Paragraph —> Remove Attributes (thanks to Martin for pointing that out to me). In Scrivener, I begin each endnote with a '»', so I can use Powerfind (Pro) to search and replace all instances of ‘. »’ with a tab, and on exporting from Scrivener, a placeholder ‘‡‡‡‡‡’ is put to mark what will be the ends of sections.
So, the whole process needs four operations: (1) select all the endnotes and remove paragraph attributes; (2) replace all ‘. »’ with tab; (3) convert section placeholders to ‘Section Break Next Page’; (4) import the relevant stylesheet from the styles library, replacing where necessary the basic styles that NWP assigns on opening the document.
I have macroized the Replace All ‘. »’ I had worked out for stage (2) and combined that with a macro that Martin kindly set up for me to replace the section placeholders in (3). But what I would really like to do is macroize (1) and (4). At the moment, I have a keystroke to invoke Paragraph —> Remove Attributes, but I have to select all the endnotes before I can apply it, and a keystroke to call my combined macro for (2) & (3); I then have to go to the styles view to import the stylesheet from the library. I have no idea how to write macros to perform operations (1) and (4), so would be eternally grateful if someone could point me in the right direction, so that, eventually, I could make a single macro to do the whole job at one go.
Thanks for reading and for any help.
Mark
So, the whole process needs four operations: (1) select all the endnotes and remove paragraph attributes; (2) replace all ‘. »’ with tab; (3) convert section placeholders to ‘Section Break Next Page’; (4) import the relevant stylesheet from the styles library, replacing where necessary the basic styles that NWP assigns on opening the document.
I have macroized the Replace All ‘. »’ I had worked out for stage (2) and combined that with a macro that Martin kindly set up for me to replace the section placeholders in (3). But what I would really like to do is macroize (1) and (4). At the moment, I have a keystroke to invoke Paragraph —> Remove Attributes, but I have to select all the endnotes before I can apply it, and a keystroke to call my combined macro for (2) & (3); I then have to go to the styles view to import the stylesheet from the library. I have no idea how to write macros to perform operations (1) and (4), so would be eternally grateful if someone could point me in the right direction, so that, eventually, I could make a single macro to do the whole job at one go.
Thanks for reading and for any help.

Mark