note end paragraph

Get help using and writing Nisus Writer Pro macros.
msebban
Posts: 47
Joined: 2012-08-12 17:00:17

note end paragraph

Post by msebban »

I would like to have note after every paragraph. how can i write a macro for that and configurate the numbering of these notes or by page or by section of the document. Someone can help me
thank's
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: note end paragraph

Post by phspaelti »

It certainly would be possible to write a macro to insert a note at the end of every paragraph. But what is going to be the content of these notes?.
philip
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: note end paragraph

Post by phspaelti »

Here is the code for a macro that inserts an empty footnote at the end of every paragraph. A macro file for download is given below:

Code: Select all

$doc = Document.active
$paraEnds = $doc.text.findAll '.$', 'Ea'
foreach $paraEnd in reversed $paraEnds
Note.insertFootnoteInTextAtIndex $doc.text, $paraEnd.bound
end
Note after every Paragraph.nwm
(16.35 KiB) Downloaded 849 times
philip
msebban
Posts: 47
Joined: 2012-08-12 17:00:17

Re: note end paragraph

Post by msebban »

Thank´s for the answer but im sorry i didnt explain Well what i need. I need to insert notes in each paragraph and not only one. Exactly the same way of à regular footnote with style sheet but instead of end of page or section, i need these notes to be at end of every paragraph. For now im doing that manually but it´s Very long and if a want to ad a note for any reason i need to number back all the notes....
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: note end paragraph

Post by phspaelti »

Did you try using the macro I made?
If you do please make sure to use it on a copy of your file. (Nisus' Undo works pretty well, but just in case.)

If the result is not what you want, how would you like the macro to work differently?
philip
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: note end paragraph

Post by phspaelti »

Okay, sorry I think I see what you want. You want the footnotes you insert in each paragraph to be at the end of that paragraph.
In Nisus this will require that you make every paragraph a section break. Then you can have the placement of the notes at the end of the paragraph, I believe.

If you want to replace all paragraph end marks in your document with section breaks, this can be done quite easily and does not require a macro.
  1. Open the Find/Replace box
  2. Set Using to Powerfind (or Powerfind Pro)
  3. In the Find box put "Gear" > Special characters > Return
  4. In the Replace box put Section Break > Same Page (from the Insert menu)
  5. Do Replace all
Addendum: I am adding a macro that will change all paragraph breaks into Section breaks:
Paragraph Breaks to Section Breaks.nwm
(16.28 KiB) Downloaded 862 times
philip
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: note end paragraph

Post by phspaelti »

Anyhow, once your paragraph breaks have been replaced with section breaks, you can insert *Endnotes* in the usual way. Make sure to go to the style sheet to change the placement of the notes to "End of Section" (from "End of Document"). I believe you will also be able to set the notes to restart the numbering "each section".
Endnotes per section.jpg
Endnotes per section.jpg (74.69 KiB) Viewed 22866 times
Hope this helps.
philip
msebban
Posts: 47
Joined: 2012-08-12 17:00:17

Re: note end paragraph

Post by msebban »

Thank´s à lot i''l try it and give you feed-back
msebban
Posts: 47
Joined: 2012-08-12 17:00:17

Re: note end paragraph

Post by msebban »

hi,
The first macro is fine but the note i got go to the end of the page. What i want is a macro to help me to make what i do manually and make me a lot pf bps
her's an example of what i do manually

i tried the second macro and i got the following error message (in french)
error on the line 5
about the find and replace solution if i'm not wrong it could be done only once the text is written. And i need to ad note when i'm writing, like a simple food note but at the end of every paragraph.
perhaps macro is not the solution,
two beers and a bagel to whom who help me
http://nisus.com/forum/posting.php?mode ... =17&t=5474#
Attachments
capture 5774-02-05 à 01.12.46.png
capture 5774-02-05 à 01.12.46.png (34.1 KiB) Viewed 22855 times
capture 5774-02-05 à 01.07.17.png
capture 5774-02-05 à 01.07.17.png (56.76 KiB) Viewed 22855 times
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: note end paragraph

Post by phspaelti »

msebban wrote: i tried the second macro and i got the following error message (in french)
error on the line 5
This is because of localisation. The macro contains a Menu command which is the English name of the command. But since you are using French, you would need to replace that with the French command.

msebban wrote:about the find and replace solution if i'm not wrong it could be done only once the text is written. And i need to ad note when i'm writing, like a simple food note but at the end of every paragraph.
perhaps macro is not the solution,
As I was trying to indicate before the way to do what you want is to use "Section breaks" rather than simple returns at the end of the relevant paragraphs.(Judging from the sample, in your case this would be after every French translation paragraph.) This should ideally be done while you are working. The macro/Find&Replace method would be useful for the sections already written, but in your case should be adjusted to only put section breaks after the French paragraphs. To make inserting the breaks easier, I would suggest assigning a convenient keyboard shortcut to the "Section break:Same page" command.

If you use section breaks in that way you can use (section) endnotes for what you want. Beyond that it is difficult to understand what kind of speeding up and/or automatisation you are hoping for.

PS: One thing for which a macro might be useful in your case, would be to convert the hand-written notes you have made so far to real notes. If you did need such a macro, it would probably best be "tailor-made" and for that it would really be best to have a short sample (a few paragraphs) of your document.
philip
msebban
Posts: 47
Joined: 2012-08-12 17:00:17

Re: note end paragraph

Post by msebban »

1) i fix the macro, it's fine
i made a test and it's going this way
Attachments
capture 5774-02-05 à 04.04.42.png
capture 5774-02-05 à 04.04.42.png (19.4 KiB) Viewed 22844 times
msebban
Posts: 47
Joined: 2012-08-12 17:00:17

Re: note end paragraph

Post by msebban »

i need now to fix the space between notes and paragraphs and insert new section to come back to a new paragraph etc…
here's a sample of the way i do it manually. all my current work is based on the same model.
I don't know how i can automatize the process…and make it it faster and easier
Thank's again for your help…..
Attachments
Vaéra Lundi.rtf
sample
(27.74 KiB) Downloaded 765 times
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: note end paragraph

Post by phspaelti »

Hello again.

I am attaching a folder below with your sample and a macro that will transform it in the way I have been suggesting. I must warn you, that I have had some (strange) difficulties with the macro, that really have nothing to do with the problem at hand. I can get the macro to work, but if it does not work for you, this may be due to such technical issues. Perhaps the guys at Nisus Soft (Martin?) can give some feedback here. I have sent them a short report of the issue.

Anyhow, if the macro does not work for you right away, try the following:
  1. Open the file you want to edit
  2. Open the macro file, so you can see the macro code
  3. Select the macro code ("Select All")
  4. Choose "Run Selection as Macro" from the "Macro" menu
At any rate, only use the macro on a copy. Keep your original file.

Finally when the macro has finished, go to the style sheet and set the endnote settings the way you want them, as explained previously.
Hope this is helpful
msebban.zip
(15.68 KiB) Downloaded 832 times
philip
msebban
Posts: 47
Joined: 2012-08-12 17:00:17

Re: note end paragraph

Post by msebban »

For now, the macro doesn't run. I have to translate it to french command.
I understood the process and it's very smart and logic
let me know if you fix the issue you get with this macro
http://nisus.com/forum/posting.php?mode ... 8ff7b1abbf#
msebban
Posts: 47
Joined: 2012-08-12 17:00:17

Re: note end paragraph

Post by msebban »

i translated the menu command as you indicated and it doesn't run
i also try the select and run selection macro it doesn't run either
the file msebban_after is very fine
Thank's a lot for your help
Attachments
capture 5774-02-05 à 14.38.53.png
capture 5774-02-05 à 14.38.53.png (15.15 KiB) Viewed 22829 times
msebban macrofr.nwm
macromsebbanfrench
(20.8 KiB) Downloaded 754 times
Post Reply