Reply to topic  [ 9 posts ] 
Changing text size by the Size:Increase By menu option 
Author Message

Joined: 2006-06-04 15:42:19
Posts: 17
Location: Toowoomba, Australia
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

_________________
Jesus heals the rift between Man and Creator.


2010-03-04 22:43:48
Profile

Joined: 2008-05-17 04:02:32
Posts: 400
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 Document
Menu ':Format:Size:Increase By...'
Send Text '7'
Press Default Button


2010-03-05 02:07:41
Profile

Joined: 2006-06-04 15:42:19
Posts: 17
Location: Toowoomba, Australia
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

_________________
Jesus heals the rift between Man and Creator.


2010-03-05 02:46:29
Profile

Joined: 2008-05-17 04:02:32
Posts: 400
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.


2010-03-05 03:59:36
Profile

Joined: 2006-06-04 15:42:19
Posts: 17
Location: Toowoomba, Australia
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

_________________
Jesus heals the rift between Man and Creator.


2010-03-05 20:36:24
Profile
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
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:
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

_________________
philip


2010-03-05 23:06:30
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
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.


2010-03-08 11:47:24
Profile WWW

Joined: 2006-06-04 15:42:19
Posts: 17
Location: Toowoomba, Australia
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

_________________
Jesus heals the rift between Man and Creator.


2010-03-08 20:29:07
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
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:
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:
Changing Text:Quote Selection
Changing Text:Parenthesize Selection

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

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


2010-03-08 23:32:20
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 9 posts ] 

Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software