\x0C (when using PowerFind Pro) finds both any break and footnote reference when in draft view. In Page view end of line in all footnotes is selected instead. I wrote a macro to substitute section break for every occurrence of page break, but it misbehaves when notes are around. Same behavior both in versions 1.0 and 1.1. Is that a bug or by design?
Greetings, Henry.
\x0C finds footnote reference
Re: \x0C finds footnote reference
To work around this, it is necessary to filter out text selections not belonging to the body text. Something like this would do the job.Groucho wrote:I wrote a macro to substitute section break for every occurrence of page break, but it misbehaves when notes are around.
Code: Select all
Require Application Version '3.1'
Debug.setDestination 'none' # set it to 'new' or 'prompt' to see debug logs
$doc = Document.active
$text = $doc.text # body text object
Find All '\f', 'E' # find all page/section breaks
$selections = $doc.textSelections
Debug.log $selections.count
$c = $selections.count - 1
# subtract one from the total number of selections
# as the index of an array is zero based
while $c >= 0
if $selections[$c].text != $text
# if this selection does not belong to the body text...
$selections.removeValueAtIndex $c
end
$c -= 1
end
Debug.log $selections.count
foreach $sel in reversed $selections
$doc.setSelection $sel
Menu ':Insert:Section Break:Next Page'
end
http://www2.odn.ne.jp/alt-quinon/files/ ... ks-nwm.zip
Re: \x0C finds footnote reference
Thanks, Kino. I was wondering whether there was a way around. Of course, this works. I didn't think of a filter. Shame on me!
Cheers, Henry
Cheers, Henry