\x0C finds footnote reference

Everything related to our flagship word processor.
Post Reply
Groucho
Posts: 497
Joined: 2007-03-03 09:55:06
Location: Europe

\x0C finds footnote reference

Post by Groucho »

\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.
User avatar
martin
Official Nisus Person
Posts: 5230
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin »

It actually only selects the last character of each footnote area, not the end of every footnote. That makes some sense, because that's where the footnotes break to the next page. However, I'd consider this undesirable behavior and will file it as a bug.
Groucho
Posts: 497
Joined: 2007-03-03 09:55:06
Location: Europe

Post by Groucho »

martin wrote:It actually only selects the last character of each footnote area, not the end of every footnote.
That's it, Martin. As it always is the way with me, I missed the right terms. Thanks.

Henry.
Kino
Posts: 400
Joined: 2008-05-17 04:02:32

Re: \x0C finds footnote reference

Post by Kino »

Groucho wrote:I wrote a macro to substitute section break for every occurrence of page break, but it misbehaves when notes are around.
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.

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
I had written a similar and probably inutilely more complicated macro for the same purpose. If you are interested in it...
http://www2.odn.ne.jp/alt-quinon/files/ ... ks-nwm.zip
Groucho
Posts: 497
Joined: 2007-03-03 09:55:06
Location: Europe

Re: \x0C finds footnote reference

Post by Groucho »

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
Post Reply