Search found 1083 matches

by phspaelti
2019-12-23 09:04:59
Forum: Nisus Writer Pro Macros
Topic: Why does the Split object surround everything with quotation marks?
Replies: 4
Views: 1937

Re: Why does the Split object surround everything with quotation marks?

Hello Bob, Just to answer your immediate question, it isn't the the .split command that is putting quotes around things, it's the Type text command that's doing that. Or to put it more accurately, the Type text creates a string context; your variable $TheFields is an array, so in the string context ...
by phspaelti
2019-12-17 18:27:30
Forum: Nisus Writer Pro Macros
Topic: Extremely basic question: How do I know if I found something
Replies: 6
Views: 2416

Re: Extremely basic question: How do I know if I found something

Obviously speed isn't going to be a real factor if the macro is simply checking one file. As a test I had it check 4 words in the Nisus Macro Language reference 1000 times. The Find version took about 17 seconds , while the .find version took about 2. But most of all the Find version was busy jumpin...
by phspaelti
2019-12-17 16:43:19
Forum: Nisus Writer Pro Macros
Topic: Extremely basic question: How do I know if I found something
Replies: 6
Views: 2416

Re: Extremely basic question: How do I know if I found something

…however if you use .findAll you will get an array of Text Selections. When the find is unsuccessful then … .findAll still returns an Array, just an empty one. And so if you wanted to do the same exercise in a situation where you need to use .findAll , then you will need to test the .count of the r...
by phspaelti
2019-12-17 16:24:56
Forum: Nisus Writer Pro Macros
Topic: Extremely basic question: How do I know if I found something
Replies: 6
Views: 2416

Re: Extremely basic question: How do I know if I found something

My previous reply was a bit short due to circumstances. I just wanted to point out 1 or 2 things. The Find command returns the number of hits—0 for none, otherwise a positive number—which is why it's possible to check it with if . However the Find command will work via the GUI, which is slow and wil...
by phspaelti
2019-12-17 07:56:14
Forum: Nisus Writer Pro Macros
Topic: Extremely basic question: How do I know if I found something
Replies: 6
Views: 2416

Re: Extremely basic question: How do I know if I found something

Find returns the number of hits. So you can write

Code: Select all

If Find $Fieldname[$i]
...
End
Or

Code: Select all

$result =  Find $Fieldname[$i]
by phspaelti
2019-12-14 06:26:01
Forum: Nisus Writer Pro
Topic: Single-page defeat of Footnote "one note per line"?
Replies: 5
Views: 2093

Re: Single-page defeat of Footnote "one note per line"?

Þorvarður wrote:
2019-12-13 21:18:24
If we now save, close and re-open the document, we can see that the style "Footnote 1" is gone …
Nisus allows only one Footnote style (and one Endnote style) per document.
by phspaelti
2019-12-13 16:05:40
Forum: Nisus Writer Pro
Topic: Single-page defeat of Footnote "one note per line"?
Replies: 5
Views: 2093

Re: Single-page defeat of Footnote "one note per line"?

Rather than trying to defeat the footnoting mechanism, wouldn't it make more sense to just uncheck the 1 footnote per line option? Since as you say most pages only have 1 footnote you wouldn't see much difference? I was also thinking you might be able to force short footnotes on separate lines by ju...
by phspaelti
2019-12-12 21:25:25
Forum: Nisus Writer Pro
Topic: Selecting first paragraphs of chapters
Replies: 5
Views: 3810

Re: Selecting first paragraphs of chapters

The original macro was hardwired to work only for Heading 2,3, & 4 . This is an updated version that lets you choose the heading styles at runtime.
by phspaelti
2019-12-05 18:22:16
Forum: Nisus Writer Pro Macros
Topic: "_text_" to italic
Replies: 4
Views: 2274

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

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

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

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

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

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

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...