Search found 1171 matches

by phspaelti
2021-05-17 05:37:59
Forum: Nisus Writer Pro Macros
Topic: How to move the insertion point into a header?
Replies: 7
Views: 154

Re: How to move the insertion point into a header?

Hello Þorvarður, The macro was actually intended for someone else, someone who has just begun to use Nisus, and he missed a feature from Mellel called "Mentions." The aim was to create a running header by bookmarking a heading and then insert a cross-reference into the header. I understood that that...
by phspaelti
2021-05-13 21:18:27
Forum: Nisus Writer Pro Macros
Topic: How to move the insertion point into a header?
Replies: 7
Views: 154

Re: How to move the insertion point into a header?

Actually once you have moved the selection to the header, you will be able to ask which section this header is attached to. So with a bit more work one could loop through all headers and determine which section they belong to and select the appropriate one. I spoke too soon. One cannot ask which sec...
by phspaelti
2021-05-13 21:13:55
Forum: Nisus Writer Pro Macros
Topic: How to move the insertion point into a header?
Replies: 7
Views: 154

Re: How to move the insertion point into a header?

Using a defined command would be a good approach: Define Command GetHeaderSelection($doc) foreach $text in $doc.allTexts if $text.documentContentType == "header" $sel = TextSelection.new $text, Range.new 0, $text.length return $sel end end return @undefined end $doc = Document.active $sel = GetHeade...
by phspaelti
2021-05-13 20:56:59
Forum: Nisus Writer Pro Macros
Topic: How to move the insertion point into a header?
Replies: 7
Views: 154

Re: How to move the insertion point into a header?

Hello Þorvarður, If your goal is to edit a header or footer, then I wouldn't bother "moving the insertion point". You can add/remove stuff using the macro language. I'd love to give you a simple command, but it"s actually going to require some work to accomplish this. Basically you will have to loop...
by phspaelti
2021-04-26 10:15:11
Forum: Nisus Writer Pro Macros
Topic: Creating a List of all Capitalsied words
Replies: 4
Views: 562

Re: Creating a List of all Capitalsied words

I would have used PowerFind for the screen-shot, but it seems that PowerFind won't let you insert a repeat bubble with (3 or more). It creates the bubble, but it just beeps and won't insert it in the Find dialog. :(
by phspaelti
2021-04-26 10:12:31
Forum: Nisus Writer Pro Macros
Topic: Creating a List of all Capitalsied words
Replies: 4
Views: 562

Re: Creating a List of all Capitalsied words

While Martin' macro will work fine for this, one might mention that you don't really need a macro for this at all. Just create an appropriate Find expression, do "Find All" to get a non-contiguous selection and then you can copy them directly to the clipboard.
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: 828

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

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: 11
Views: 2063

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: 11
Views: 2063

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: 11
Views: 2063

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: 11
Views: 2063

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

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

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

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: