Search found 1026 matches

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: 34

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: 48

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: 37

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: 37

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: 37

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: 37

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: 1109

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: 1109

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: 1109

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: 1109

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: 1109

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...
by phspaelti
2019-11-04 08:14:14
Forum: Nisus Writer Pro Macros
Topic: Get the caret out of a table
Replies: 10
Views: 1109

Re: Get the caret out of a table

There are two ways to select a table: (1) if you do "Select All" twice, Nisus will select all the cells of the table, or (2) if you use the mouse to select from right before the table to right after the table. These two ways are quite distinct from Nisus' point of view. For Nisus a table is treated ...
by phspaelti
2019-10-26 03:31:53
Forum: Nisus Writer Pro
Topic: deleting paragraph style B and replacing it with paragraph style A
Replies: 13
Views: 1245

Re: deleting paragraph style B and replacing it with paragraph style A

Hello shmuel, One thing that was bothering me a bit was that although after all occurrences of text in paragraph style B have been replaced this way by paragraph style A, when I then went on to delete paragraph style B from the style sheet, I was told that "This style is currently used in the docume...
by phspaelti
2019-10-26 00:31:42
Forum: Nisus Writer Pro
Topic: deleting paragraph style B and replacing it with paragraph style A
Replies: 13
Views: 1245

Re: deleting paragraph style B and replacing it with paragraph style A

I would to know where I can find "Choose Paragraph Style:Select All in Style" in the menus? I can see there is a "Paragraph Style" in the Format menu but it does not have a "Select All in Style" option. Really? Mine does. Select_All_In_Style_1.jpg Also you should be able to find it in the Paragraph...
by phspaelti
2019-10-25 08:11:07
Forum: Nisus Writer Pro
Topic: removing attribute overrides in Footnote Note Style
Replies: 5
Views: 534

Re: removing attribute overrides in Footnote Note Style

But can I ask you, as a real expert, is there a way to select all footnotes without having to move the cursor into a footnote first, perhaps using a macro? The normal way to do this would indeed be to click in a footnote and then do "Select All" twice. (The first selects, the note, the second selec...