Page 1 of 1

Changing text size by the Size:Increase By menu option

Posted: 2010-03-04 22:43:48
by paulcruice
Very quickly. How do I write a Macro which selects all text and increases the text size by, say 7pts.
I have tried the following but it does not work.

Select All
Size:Increase by: 7pts

Look forward to the help.
Cheers,
Paul

Re: Changing text size by the Size:Increase By menu option

Posted: 2010-03-05 02:07:41
by Kino
Unlike NW Classic, NWP does not understand a command syntax such as Increase By 7. So you have to type “7” in the Increase Font Size sheet. For that, you can use Send Text command, not Type Text command which does not work for a text field not belonging to the text edit area.

Code: Select all

 Select All Document
Menu ':Format:Size:Increase By...'
Send Text '7'
Press Default Button

Re: Changing text size by the Size:Increase By menu option

Posted: 2010-03-05 02:46:29
by paulcruice
Thanks Kino. I'll give it a go.
Why is it, that this is not mentioned in the Macro Reference or the NisusWriter Pro User Guide?
Cheers,
Paul

Re: Changing text size by the Size:Increase By menu option

Posted: 2010-03-05 03:59:36
by Kino
Yes, me too, I think it would be more friendly (more kind for ex-NW Classic users at least) if it were written somewhere that you cannot add an argument to menu commands such as “Increase By...” (The page 338 of help.pdf tells that “Many Menu Commands accept a variety of parameters, that limit or define the scope of that particular command, as arguments” but I think it is a typo: it should be “non-Menu Commands”).

As to why you have to use Send Text command in such a situation, you will find an explanatory note in the Reference just under the description of the command. Of course, for those who are not familiar with the macro command set, it would not be so easy to find out the appropriate command from among the numerous commands. A tutorial having many examples would be helpful.

Re: Changing text size by the Size:Increase By menu option

Posted: 2010-03-05 20:36:24
by paulcruice
Kino,
Does Nisus listen to what is said on this forum or do we have to take such ideas as you expressed directly to them? Seems to me the guides etc are still being developed. Would be nice too if they wrote the basics for ordinary people i.e. non-programmers.

While I have you, how do I link a number of macros together so they work one after the other automatically. I have tried putting the individual macros one under each other in the one macro document but I did leave a Return between each one and all this does not work. Again it would be helpful if they would even discuss this in any of the literature.

Thanks for your help.
Paul

Re: Changing text size by the Size:Increase By menu option

Posted: 2010-03-05 23:06:30
by phspaelti
Hello Paul,
there are at least two ways you can chain macros together. Let's assume you have 3 macros: Macro_A, Macro_B, Macro_C.

You could write another macro like this:

Code: Select all

Macro_A
Macro_B
Macro_C
That should work fine.
From your comments I am thinking maybe you tried pasting the actual macro code of the macros together in a single macro file. That should work as well, but it depends on the macro code. For example if one of the macros contains an exit statement, then the execution will stop at that point. So if the Macro_A code aborts if there is no selection, for example, then the combined macro will not do anything either.
So the above method is probably better for chaining macros.

Hope this helps
Philip

Re: Changing text size by the Size:Increase By menu option

Posted: 2010-03-08 11:47:24
by martin
paulcruice wrote:Does Nisus listen to what is said on this forum or do we have to take such ideas as you expressed directly to them?
We definitely read what is written on our forums, although direct emails are appreciated. Also, even if someone else has expressed thoughts you've had yourself, it's good to add your voice, so we can know how many people are interested in a particular enhancement/etc.

Re: Changing text size by the Size:Increase By menu option

Posted: 2010-03-08 20:29:07
by paulcruice
Philip,
I tried your method presumably using the code as follows:
Macro: NameOfMacro
Macro: NameOfMacro
etc.
but still wouldn't work.
Is it important that the word Macro be followed by the "_" symbol exactly as you had it and/or is there a need for the colon symbol after the word Macro as one does when calling menu items???

Have since sent an email directly to Nisus Support but haven't heard back yet.
Thanks,
Paul

Re: Changing text size by the Size:Increase By menu option

Posted: 2010-03-08 23:32:20
by martin
paulcruice wrote:I tried your method presumably using the code as follows:
Macro: NameOfMacro
Macro: NameOfMacro
etc.
but still wouldn't work.
Is it important that the word Macro be followed by the "_" symbol exactly as you had it and/or is there a need for the colon symbol after the word Macro as one does when calling menu items???
There's no need for underscores ("_") unless it is present in the macro name. And colons are only required when there is an ambiguity in the menu/macro name and one needs to use a longer path. As a real example, let's say you wanted a macro that both quoted and parenthesized a selection. That macro could then simply be the commands:

Code: Select all

Quote Selection
Parenthesize Selection
If you wanted to get specific (or there were multiple commands/macros with the same names), the macro could be:

Code: Select all

Changing Text:Quote Selection
Changing Text:Parenthesize Selection
Or even more explicit:

Code: Select all

Macro:Changing Text:Quote Selection
Macro:Changing Text:Parenthesize Selection
Or the equivalent, and ever-so-slightly more efficient:

Code: Select all

:Macro:Changing Text:Quote Selection
:Macro:Changing Text:Parenthesize Selection