Noob Needs Help

Get help using and writing Nisus Writer Pro macros.
Post Reply
budnbess
Posts: 2
Joined: 2020-01-29 06:35:11

Noob Needs Help

Post by budnbess »

I know nothing about programming (language or grammar.)
I want to set up simple formatting macros so that I can place the insertion point at the beginning of the paragraph I want to format, run a macro, and have the paragraph change.
The exact parameters of the macro I am trying to accomplish is to set topic subject lines to 35 points.
What I have so far:

Select paragraph
Format:Size:Other

These commands do what I want them to, but I am still having to enter the value "35" manually because I don't know the grammar to put it into the macro. I know this sounds really easy, but I have tried at least 20 different combinations trying to get the value to enter and finish the macro, and none of them have worked. In this particular macro I would also like to set the space after paragraph for 14pts.

I am not completely stupid, so if I can see this one thing and learn how it is structured, I might be able to write the rest of the formatting macros that will get me through some rather large files quickly.

Any help is greatly appreciated.
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Noob Needs Help

Post by martin »

That's a great question, and a good way to introduce the difference between regular menu commands and other macro language features.

As you've already discovered, macros can easily make use of regular menus via a menu title or path. That's how "Select Paragraph" works, and it's how other simple formatting commands work too. So if you had wanted to make the whole paragraph bold your macro would be just:

Code: Select all

Select Paragraph
Bold
To change the font size you can use the Format > Size menu via a macro like:

Code: Select all

Select Paragraph
Format:Size:24
The complication you face is that the font size you want (35 points) does not appear on the menu. You'll have to use macro commands and features that do not appear on the regular menus. If you look at the Macro Language Reference (available on the Help menu and online) and search for font size you'll see a command called "Set Font Size" that allows you to choose a custom size, without using an interactive dialog. Your final macro code is:

Code: Select all

Select Paragraph
Set Font Size 35
I hope that helps! Please let us know if you have any more questions.
budnbess
Posts: 2
Joined: 2020-01-29 06:35:11

Re: Noob Needs Help

Post by budnbess »

Update.

Actually, I found an easier way.

Since I am dealing with paragraphs, I can set a new paragraph style from selection.

All I have to do is format one paragraph correctly, and then select Format/Paragraph Style/New Paragraph Style from Selection and give it a descriptive name.

Essentially the Writer creates a new macro for me.
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Noob Needs Help

Post by martin »

Styles are definitely the way to go, if they suit your needs. That's going to be much better than a macro. I'm glad you found a solution for your workflow.
Post Reply