Search found 1030 matches

by phspaelti
2019-12-05 18:22:16
Forum: Nisus Writer Pro Macros
Topic: "_text_" to italic
Replies: 4
Views: 117

Re: "_text_" to italic

It's not at all obvious why you wouldn't use "AnyText" as the wildcard. Indeed it is not. Consider the following case: _Nisus_ Writer is a great _document_ processor. If you ask: "What is the text between two underlines?", you might answer "Nisus" and "document". But there is another possible answe...
by phspaelti
2019-12-04 20:19:32
Forum: Nisus Writer Pro
Topic: Is it possible to find all shapes?
Replies: 1
Views: 102

Re: Is it possible to find all shapes?

The Tools menu has Shapes > Select Next Shape/Select All Shapes.

Also look at this topic http://www.nisus.com/forum/viewtopic.ph ... 962#p23962.
by phspaelti
2019-12-04 06:46:57
Forum: Nisus Writer Pro
Topic: excluding levels from the document TOC
Replies: 3
Views: 137

Re: excluding levels from the document TOC

As far as I can see, this does not seem to be possible. A possible workaround is as follows: Save the styles relevant for the TOC in a style sheet called "Full TOC". Remove the "include in TOC" from levels 4-6. Save the relevant styles in a style sheet called "Short TOC". Now you can switch between ...
by phspaelti
2019-12-03 08:30:50
Forum: Nisus Writer Pro Macros
Topic: "_text_" to italic
Replies: 4
Views: 117

Re: "_text_" to italic

… what I need: find text, change format …and presumably remove the underlines? Actually for this kind of thing you don't even need a macro. You can use Find/Replace: Find_Replace_Markup_with_Italics.png Note that the replace expression has the Italics applied. You can of course macroize the above, ...
by phspaelti
2019-11-20 22:13:33
Forum: Nisus Writer Pro
Topic: How to move/copy styles from one doc to another
Replies: 1
Views: 308

Re: How to move/copy styles from one doc to another

From your description of the problem, you already have the styles you want in a Style Library file, and you know how to find the Style Library (files) in the Document Manager. To get styles from there into your current document, you have two options. (1) With the target document in front, choose Ins...
by phspaelti
2019-11-20 07:30:52
Forum: Nisus Writer Pro
Topic: text color
Replies: 4
Views: 414

Re: text color

The simple answer is "no". Styles in Nisus are "sticky", so if you click into a text and start typing you will get the style of the surrounding text. There are two things you could do: (1) You can set up a style to be the "Next style". However this will only work for paragraph styles. So you will ne...
by phspaelti
2019-11-18 19:56:40
Forum: Nisus Writer Pro Macros
Topic: Styles 'Document' not a regular object? Error unknown macro command.
Replies: 4
Views: 495

Re: Styles 'Document' not a regular object? Error unknown macro command.

Addendum: Actually the above macro will only work correctly, if both types of mark-up are indeed present. To have it work correctly for all cases, one should wrap the style application in a test to avoid having it applied to the wrong thing. $bits = $aDoc.text.findAndReplace('@@@emph\((.+?)\)emph_en...
by phspaelti
2019-11-18 10:07:29
Forum: Nisus Writer Pro Macros
Topic: Styles 'Document' not a regular object? Error unknown macro command.
Replies: 4
Views: 495

Re: Styles 'Document' not a regular object? Error unknown macro command.

So here is my suggestion how to do what you seem to want: $aDoc=Document.Active $styles = Hash.new $styles{"Emphatic"} = $aDoc.styleWithName "Emphatic" $styles{"Strong"} = $aDoc.styleWithName "Strong" $bits = $aDoc.text.findAndReplace('@@@emph\((.+?)\)emph_end', '\1', 'Ea') $aDoc.setSelection $bits ...
by phspaelti
2019-11-18 09:33:28
Forum: Nisus Writer Pro Macros
Topic: Styles 'Document' not a regular object? Error unknown macro command.
Replies: 4
Views: 495

Re: Styles 'Document' not a regular object? Error unknown macro command.

And on a more general note, may I ask what you are trying to do here? It looks like you are using a very baroque form of style markup. But why are you going to the trouble of first inserting this markup using perl only to remove it again after applying the style? If you skip all that perl you won't ...
by phspaelti
2019-11-18 09:18:57
Forum: Nisus Writer Pro Macros
Topic: Styles 'Document' not a regular object? Error unknown macro command.
Replies: 4
Views: 495

Re: Styles 'Document' not a regular object? Error unknown macro command.

Hello Martin, The command will need to be applied to a specific instance of a document object. You can't apply it to the constructor. So in your case it would presumably have to be: $styles = Hash.new $styles["Emphatic"] = $aDoc.styleWithName "Emphatic" $styles["Strong"] = $aDoc.styleWithName "Stron...
by phspaelti
2019-11-06 01:13:05
Forum: Nisus Writer Pro Macros
Topic: Get the caret out of a table
Replies: 10
Views: 1546

Re: Get the caret out of a table

You showed how to create shading attributes with a macro, and then asked: But maybe your problem is something else? How are you getting/making the table selection? To answer that: I made selections manually, by selecting (some or all) text within some cells. The menu "Show Paragraph Shading Palette...
by phspaelti
2019-11-06 00:31:09
Forum: Nisus Writer Pro Macros
Topic: Get the caret out of a table
Replies: 10
Views: 1546

Re: Get the caret out of a table

js wrote:
2019-11-05 09:21:22
About your short form of the macro you say "that should be fixed now". Did you maybe intend to post the fixed code?
I just fixed the code in the original post.
by phspaelti
2019-11-04 11:06:47
Forum: Nisus Writer Pro Macros
Topic: Get the caret out of a table
Replies: 10
Views: 1546

Re: Get the caret out of a table

Thank you, Philip. Outquoting the line "$textRange.location = $textRange.bound" works fine. Some day I might understand why )=; Here are the relevant lines $text = $table.enclosingText $textRange = $table.enclosingTextRange $textRange.location = $textRange.bound $textRange.length = 0 The first line...
by phspaelti
2019-11-04 10:41:15
Forum: Nisus Writer Pro Macros
Topic: Get the caret out of a table
Replies: 10
Views: 1546

Re: Get the caret out of a table

js wrote:
2019-11-04 10:35:26
Your simplified version produces a system complaint: 'The Table object does not have a "text" property'.
Sorry about that. That should be fixed now.
by phspaelti
2019-11-04 08:32:05
Forum: Nisus Writer Pro Macros
Topic: Get the caret out of a table
Replies: 10
Views: 1546

Re: Get the caret out of a table

I have another problem with tables: I tried in vain to find out how to get a macro to apply shading to selected single cells (rather than to set shading to paragraphs which produces shading to the whole row containing the selected cells). Assuming you have created some shading attributes and stored...