Thanks so much for your help; it’s really appreciated.
phspaelti wrote:Hello Mark,
from the way you describe it, it seems that Nisus in fact doesn't recognise the endnotes. Wouldn't you want the notes converted to real endnotes, i.e., notes linked to a reference marker in the text, with the numbering and formatting handled by the endnote style? If so you might have to approach the whole problem a bit differently.
In fact, NWP does recognise the notes as endnotes — or footnotes if preferred. Keith has modified the standard Apple Text Engine and the RTF produced by the exporter, so that they do have the necessary codes. When I said “a zero style-marker”, I should have found a better way of putting it; they are marked as endnotes, so for instance have the relevant indices in the text and the note, the separator line, respond to changes in the style sheet, etc.; but they have no attributes, such as ruler with hanging indents, different font size from main text, etc. Those are all set in the “Book” style-sheet I have created, and when that is imported using Martin’s macro, they change immediately. That part is not a problem. The point is, if you like that the only "styles" exported by Scrivener are endnotes, footnotes and comments, but they are minimalist in the sense that they use the default ruler, font, etc. All else, for the moment, is a way of storing and ‘painting’ paragraph attributes during editing, which can be retained or over-ridden during export, but which are not fully fledged paragraph styles as in NWP, Word, etc. and changing the attributes of any stored format doesn’t change any existing paragraphs that have used that preset style.
phspaelti wrote:But putting that aside, let's consider how you would do the two tasks you are asking about.
For task (1) you can just do it exactly as you describe it: you select the endnote paragraphs, then do Paragraph —> Remove Attributes. Selection would need to be handled via Powerfind (Pro). This would look approximately like this:
Code: Select all
Find All '^\d+\. .+', 'Ea'
Format:Paragraph:Remove Paragraph Attributes
I’ve tested this one. if I open the exported file and run this macro, it does nothing. If I scroll down to the endnote area, place the caret at the beginning of the first note, and run the macro it only selects and removes the attributes in the first note; it doesn’t find all instances. If I select all the endnotes manually, and then run the macro, it then replaces the attributes on all of them. But without the “Find All” working, it is just as quick to use my shortcut keystroke. The current part document has 168 notes; the final document will run to several times that amount.
phspaelti wrote:For task (4) 'importing a style sheet' really just means adding certain styles to your document. This can be done easily with the following lines of macro code:
Code: Select all
$doc = Document.active
$doc.addStyles 'Paragraph style 1', 'replace'
$doc.addStyles 'Paragraph style 2', 'replace'
…
Repeat for as many styles as you want to add. Just make sure to apply the actual style to the '.addStyles' lines, since that is how Nisus imports the style.
The stylesheet I import is titled “Book” and actually contains 30 style definitions in total under character, paragraph, notes and lists — many of the main ones are duplicated to handle Chinese and English — and I suspect I will need a few more. Is there a way to import the “Book” stylesheet and all the styles in one go, or am I right in thinking I will need to list all those that are relevant individually — there may be some, say in the “lists” section which are redundant. if so, how to I reference them? Like this:
Code: Select all
$doc = Document.active
$doc.addStyles ‘Heading 1', ‘Document Manager:Styles:Book:Heading 1’
…
and for inserting a new style rather than replacing an existing one:
Code: Select all
...
$doc.addStyles ‘Document Manager:Styles:Book:Chinese Block Quote’
…
phspaelti wrote:Hope this helps. Ask again if you still have questions.
It does help indeed, even though I still don’t know why the first doesn’t work, nor entirely how to set about the second. But I am really grateful all the same.
Mark