Need TOC Macro for Journal/Diary

Get help using and writing Nisus Writer Pro macros.
Post Reply
Will N too
Posts: 6
Joined: 2017-06-13 09:21:48

Need TOC Macro for Journal/Diary

Post by Will N too »

I don't know if this is possible. I want to be able to create a new document, with an entire year's dates pasted in, and then have a macro add them to the TOC as 365 separate entries, with hard returns between each day so when I make my entries, they don't extend the TOC date entry.
I auto create a year's worth of days and dates, then I export them into a new NisusWriter Pro document. Ideally, the weekday, month date is in bold, after the year are a couple of hard returns. See below:
Monday, Jan 29, 2018

Tuesday, Jan 30, 2018
This is easy to do. No problems.

The real time consumer: I use the Navigator panel for moving around my journal. (And please let me know if this is ill advised or if there's a better way). I use the TOC/Navigator LEVELS 1-5 for Monday through Friday, and 3,4 for Sat and Sun.
This way they stand out in the Navigator side panel.
Example:
Monday, Jan 29
-----Tuesday, Jan 30
----------Wednesday, Jan 31
---------------Thursday, Feb 1
--------------------Friday, Feb 2
---------- Saturday, Feb 3
------------------- Sunday, Feb 4 (I added the dashes because this message eliminates spaces and there are no tabs)

If I try to add multiple dates to TOC in one go, then they all go in as one entry. (I leave the year out of TOC because 1. I don't need it, but also 2. So it doesn't extend the TOC entry. I've found that if the TOC item includes spaces at the end and I start typing in those spaces, I can wind up with a thousand word TOC entry. Leaving off the year number keeps this from happening.
[I once tried using FileMaker Pro for a journal. Worked great. I could write for hours and then FMP just deleted everything past a certain small number of characters.]
My current journal is over 2 million characters. I like using the journal for many reasons, one of the best is that I can then just search for specific words and immediately find my entry or notes on that topic. I usually wind up spending more than a few hours adding each date into the Navigator/TOC one at a time. Also when I'm writing something with multiple chapters/sections I'd like to be able to do the same thing with the outline I've pasted to organize my writing.
Thanks
Þorvarður
Posts: 410
Joined: 2012-12-19 05:02:52

Re: Need TOC Macro for Journal/Diary

Post by Þorvarður »

Will N too wrote:I once tried using FileMaker Pro for a journal. Worked great. I could write for hours and then FMP just deleted everything past a certain small number of characters.
How can that be? The technical specifications of FileMaker Pro 12 and newer say that you can have up to 1 billion characters per field (limited by available memory.)
They don't say how much memory one needs for a field with 1 billion characters though. :-)
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Need TOC Macro for Journal/Diary

Post by phspaelti »

Hello Will,
Try the following macro. To run it make sure to select the last date in your file (e.g. Sunday, Feb 5, 2017). The macro should then add a year's worth of dates with TOC formating per your instructions.
NB: Try running it on a test file to see how it works, before running it on something important.
Attachments
Create Journal Dates (Will N Too).nwm
(4.2 KiB) Downloaded 886 times
philip
Þorvarður
Posts: 410
Joined: 2012-12-19 05:02:52

Re: Need TOC Macro for Journal/Diary

Post by Þorvarður »

Hello Philip,

Thank you for this very useful macro.

I don't know if it's just me, but when I run the macro unaltered, I get this error:

Unknown menu item path: Set Bold @true

If I remove the line, I get:

Unknown menu item path: Set Bold @false

If I just use "Bold", it runs fine.

Code: Select all

Bold
Type Text $textDate
Bold
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Need TOC Macro for Journal/Diary

Post by phspaelti »

Þorvarður wrote:I don't know if it's just me, but when I run the macro unaltered, I get this error:

Unknown menu item path: Set Bold @true
The macro documentation lists the Set Bold @true/false as being part of the language since NWP v.2.1.5. Is it possible you are still running something older? (I'm on 2.1.7).

Obviously using Bold will work, but Bold just toggles the state, so you can't be sure whether you are turning it on or off.
philip
Þorvarður
Posts: 410
Joined: 2012-12-19 05:02:52

Re: Need TOC Macro for Journal/Diary

Post by Þorvarður »

phspaelti wrote:Is it possible you are still running something older?
Yes, you are right. That's the reason then. Thanks for clarifying.
Post Reply