Page 1 of 1

running through the items of a non-contiguous selection

Posted: 2010-10-06 22:33:39
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?

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

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

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

Posted: 2010-10-07 05:48:01
by js
Fabulous. Just what I was looking for!