Search found 1165 matches

by phspaelti
2021-04-09 05:45:37
Forum: Nisus Writer Pro Macros
Topic: How to apply user hilite to selected text
Replies: 2
Views: 202

Re: How to apply user hilite to selected text

Try this instead.

Code: Select all

$myHilite = Color.newWithRGB255(255, 252, 163)
Set Highlight Color $myHilite
:wink:
by phspaelti
2021-04-06 17:07:21
Forum: Nisus Writer Pro
Topic: Removing Periods after Footnote Numerals
Replies: 3
Views: 313

Re: Removing Periods after Footnote Numerals

Because in the footnote style sheet, there is an option under "note References" where you can control the period; it appears in the "after text" box. Delete that period and it should delete it. But if my memory serves, this may depend on the version of Nisus you are running. Older versions inserted...
by phspaelti
2021-04-06 16:59:13
Forum: Nisus Writer Pro Macros
Topic: Create array from word list?
Replies: 10
Views: 804

Re: Create array from word list?

I was just kidding. .arrayByMakingValuesDoCommand is my favorite macro language feature and I go out of my way to use it whenever I can :D I think the current Nisus macro language is a very good balance between powerful and still manageable for someone who doesn't want to become a full-time programm...
by phspaelti
2021-04-04 08:14:58
Forum: Nisus Writer Pro Macros
Topic: Create array from word list?
Replies: 10
Views: 804

Re: Create array from word list?

B.Otter wrote:
2021-04-04 07:45:39
Up late?
So it would seem… Happens too often
by phspaelti
2021-04-04 06:57:43
Forum: Nisus Writer Pro Macros
Topic: Create array from word list?
Replies: 10
Views: 804

Re: Create array from word list?

In way of explanation: Nisus' strong point is Find . In the macro language a Find statement used on a text object will produce a selection object, or, if you use the "Find All" option, an array of selections. So the first thing is to write the Find statement that you want. I wrote: $doc.text.find '^...
by phspaelti
2021-04-04 06:37:11
Forum: Nisus Writer Pro Macros
Topic: Create array from word list?
Replies: 10
Views: 804

Re: Create array from word list?

Code: Select all

$doc = Document.active
$wordSels = $doc.text.find '^\w+', 'Ea'
$words = $wordSels.arrayByMakingValuesDoCommand 'substring'
$words.randomize
Document.newWithText $words.join("\n")
by phspaelti
2021-04-02 16:20:45
Forum: Nisus Writer Pro
Topic: Text-wrapping graphic on every page
Replies: 3
Views: 1929

Re: Text-wrapping graphic on every page

I am appending here a macro that will copy the first floating contents of your file to every following page. It will also make sure to copy and adjust the settings - including text flow. Note that you will need to insert the first one manually before you run this. This will probably work best if you...
by phspaelti
2021-03-30 09:28:37
Forum: Nisus Writer Pro Macros
Topic: How to create a variable for "Any digit"?
Replies: 12
Views: 1895

Re: How to create a variable for "Any digit"?

So comparing all the different digits you would join together macro code like ($number == 1) || ($number == 2) || ($number == 3) || ... … and with the added wrinkle that you will need to further combine the expressions pairwise with further parentheses. This truly reminds me of Mark Twain's essay T...
by phspaelti
2021-03-29 18:03:27
Forum: Nisus Writer Pro Macros
Topic: How to create a variable for "Any digit"?
Replies: 12
Views: 1895

Re: How to create a variable for "Any digit"?

martin wrote:
2021-03-29 11:24:02
$searchRange = Range.new(0, $selection.location)
$foundSelection = $selection.text.find('\d+', 'Er', $searchRange)
That's been one of those features that I have been looking for for some time now. Seems it was introduced in NW 3.0 but it slipped by me for some reason. :drunk:
by phspaelti
2021-03-29 07:02:43
Forum: Nisus Writer Pro Macros
Topic: How to create a variable for "Any digit"?
Replies: 12
Views: 1895

Re: How to create a variable for "Any digit"?

If you understood all that you can now squeeze the whole logic into one statement like this: $sel = TextSelection.active if $sel.text.substringInRange(Range.new($sel.location - 1, 1)).find('\d','E') prompt 'digit' else prompt 'not a digit' end But whether that's recommended is another question :lol:
by phspaelti
2021-03-29 06:51:50
Forum: Nisus Writer Pro Macros
Topic: How to create a variable for "Any digit"?
Replies: 12
Views: 1895

Re: How to create a variable for "Any digit"?

if $theFoundCharacter = ? … else … end How can I replace the question mark with something that indicates "Any digit" or that a digit was found? Here the first thing to note is that if you want to test a variable you will need to use the double equal sign "==", not just a single one. So you could te...
by phspaelti
2021-03-29 06:50:57
Forum: Nisus Writer Pro Macros
Topic: How to create a variable for "Any digit"?
Replies: 12
Views: 1895

Re: How to create a variable for "Any digit"?

I need to find out whether the character that precedes the insertion point is a number or not. In case it's a number, the macro will do some stuff. In case it's not, the macro will do some other stuff. How can I do that? I tried $theFoundCharacter = Find @Text<\X>, 'rE' This will not give you what ...
by phspaelti
2021-03-01 16:58:59
Forum: Nisus Writer Pro
Topic: Initials
Replies: 18
Views: 12330

Re: Initials

I'm sorry that you had such trouble. If you can save a document with problems like that you might want to share it (Perhaps with Nisus using the feedback button. Tell them I sent you :P ) I just tried a very simple test: 10 Pages of copied text. I randomly inserted 17 Drop Caps without a hitch. My s...
by phspaelti
2021-03-01 01:34:47
Forum: Nisus Writer Pro
Topic: Initials
Replies: 18
Views: 12330

Re: Initials

Here is my 2 cents on this issue. I am attaching a group of 3 macros which might help a bit. Let's assume you have one drop cap in your document already. Place your cursor in a subsequent paragraph where you want another. Then run the first macro: Insert DropCap At Current Paragraph This macro will ...
by phspaelti
2021-02-26 20:33:40
Forum: Nisus Writer Pro Macros
Topic: Compare and Remove Duplicates — 2 Lists
Replies: 5
Views: 1659

Re: Compare and Remove Duplicates — 2 Lists

Adrian's method is fine, and I use it all the time, but there are number of caveats. Strictly speaking Adrian's method creates a combined list and then removes items that can be paired. If either list contains duplicates, this could change the result. Also it will leave the unique items from either ...