Search found 1046 matches

by phspaelti
2019-12-29 18:12:50
Forum: Nisus Writer Pro Macros
Topic: Foreach Command and Variable Scope
Replies: 2
Views: 347

Re: Foreach Command and Variable Scope

You've got that exactly right. The iterator variable of the foreach loop is a local copy. So changing it does not persist beyond the loop. One way to achieve what you want is to use the index to access the original. Note that the foreach loop has a variant that allows you to get the index of the cur...
by phspaelti
2019-12-27 19:34:43
Forum: Nisus Writer Pro Macros
Topic: Boolean Operation Evaluation
Replies: 3
Views: 973

Re: Boolean Operation Evaluation

Hello Bob, Have you tried them? :wink: The point you bring up is moot, since Nisus does not allow you to combine different operators in one expression. The work around that it does allow is for you to use parentheses. So you will have to specify the operator precedence yourself using parentheses any...
by phspaelti
2019-12-27 16:46:03
Forum: Nisus Writer Pro
Topic: How to prevent text to be modified
Replies: 14
Views: 1398

Re: How to prevent text to be modified

(2) Create a Macro called "Select All Except". It has two lines:– Find All @Text<(?:.|\n|\f)+>, 'Eau' Invert Selection In the first line, you need to apply the “Skip Me” Style to the string between “<“ and ”>”, but don’t include “<“ or ”>”. Now save the Macro. In order to avoid the need to mess aro...
by phspaelti
2019-12-27 16:28:04
Forum: Nisus Writer Pro
Topic: How to prevent text to be modified
Replies: 14
Views: 1398

Re: How to prevent text to be modified

At the very least, I would like to have the option to set the scope to “In Selection” using a modifier key. So a macro to do this would be: $find = Read Find Expression Find $find, '!*s' This uses the '*' to preserve all other options. And a macro to reset to full document search would be: $find = ...
by phspaelti
2019-12-27 16:05:01
Forum: Nisus Writer Pro
Topic: How to prevent text to be modified
Replies: 14
Views: 1398

Re: How to prevent text to be modified

I know of no inbuilt way to reset all the Find & Replace parameters to some default set. From the macro reference (under Find and Replace options):     !    Copy text/options into the Find & Replace dialog instead of doing an actual find/replace. So you can write a one line macro like this: Find ''...
by phspaelti
2019-12-23 10:09:53
Forum: Nisus Writer Pro
Topic: Disable "Center the Cursor"
Replies: 2
Views: 503

Re: Disable "Center the Cursor"

Make sure View > Typewriter Scrolling is unchecked.
by phspaelti
2019-12-23 09:54:23
Forum: Nisus Writer Pro Macros
Topic: Why does the Split object surround everything with quotation marks?
Replies: 4
Views: 511

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

And one more point: You mention "valid CSV". If the stuff you are trying to split into fields is CSV you might note that the .split command will not give you the correct result in the general case, since quoted fields will be used to protect commas within fields. But I'm sure you know that already. ...
by phspaelti
2019-12-23 09:24:37
Forum: Nisus Writer Pro Macros
Topic: Why does the Split object surround everything with quotation marks?
Replies: 4
Views: 511

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

Now let's address the efficiency issue. Your current code keeps switching back and forth between two documents using the GUI. It also collects the paragraph info one paragraph at a time. The much more efficient method is to locate the paragraphs in $TempDoc first , then assemble the info, then switc...
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: 511

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

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

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

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

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

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

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