running through the items of a non-contiguous selection

Get help using and writing Nisus Writer Pro macros.
Post Reply
js
Posts: 259
Joined: 2007-04-12 14:59:36

running through the items of a non-contiguous selection

Post by js »

Certain Services can be applied only to a contigous selection. Is it possible for a Nisus macro to run through the items of a non-contiguous selection (just like running through list items f.e.) to apply a service consecutively?
Kino
Posts: 400
Joined: 2008-05-17 04:02:32

Re: running through the items of a non-contiguous selection

Post by Kino »

You can use something like this.

Code: Select all

$doc = Document.active
$sels = $doc.textSelections
foreach $sel in reversed $sels
	$doc.setSelection $sel
	Document.setActive $doc
	Menu ':Nisus Writer Pro:Services:New TextEdit Window Containing Selection'
end
js
Posts: 259
Joined: 2007-04-12 14:59:36

Re: running through the items of a non-contiguous selection

Post by js »

Fabulous. Just what I was looking for!
Post Reply