I have a suggestion for improving the excellent Compare Documents macro that's preinstalled with NWP (originally written by Kino).
Append the following two steps to the macro:
Find '(AnyText)(Or)(AnyText)', 'euW!'
Menu 'Find:Show Find…'
This opens a Find dialog pre-loaded with criteria to find any text colored pink or green by the Compare Documents macro. This makes it easier to find all changed text.
Compare Documents macro: suggestion to preload Find dialog
Re: Compare Documents macro: suggestion to preload Find dia
Thank you very much for the excellent suggestion. Yes, it would be hard to find all changed texts when the target document is large. To make the task easier, using the attribute sensitive search would be a nice idea. However, personally, I’d like to use the Find panel for something else.
So I wrote a macro (not tested sufficiently, sorry) which adds bookmarks to all texts having some background colour (i. e. not white background colour).
Note that you can change the highlighting color of “Bookmarked” texts in NWP’s Preferences > Appearance > Customized colors > Marked Text > Bookmarked (autoname).
So I wrote a macro (not tested sufficiently, sorry) which adds bookmarks to all texts having some background colour (i. e. not white background colour).
Code: Select all
### Add Bookmak to Texts Having Background Colors ###
Require Pro Version '2.1'
$doc = Document.active
if $doc == @undefined
exit 'No open document. Exiting...'
end
$white = Color.white
$withBGC = Array.new
foreach $text in $doc.allTexts
if $text.length
$i = 0
while $i < $text.length
$bgc = $text.displayAttributesAtIndex($i).textBackgroundColor
$range = $text.rangeOfDisplayAttributesAtIndex($i)
if $bgc != $white
$sel = TextSelection.new($text, $range)
$withBGC.appendValue($sel)
end
$i = $range.bound
end
end
end
if ! $withBGC.count
exit 'No text having background colors found. Exiting...'
end
Push Target Selection $withBGC
Add Bookmark
Pop Target Selection
Set Navigator Mode 'Bookmarks by Location'
Set Navigator Shown @true
### end of macro ###
Re: Compare Documents macro: suggestion to preload Find dia
Excellent idea, Kino-san! Thanks!