running through the items of a non-contiguous selection

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

running through the items of a non-contiguous selection

Post by js » 2010-10-06 22:33:39

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 » 2010-10-07 02:01:32

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: 229
Joined: 2007-04-12 14:59:36

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

Post by js » 2010-10-07 05:48:01

Fabulous. Just what I was looking for!

Post Reply