Find Insertion Point 2
Find Insertion Point 2
- Subject: Find Insertion Point 2
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 14 Dec 2000 20:32:32 -0800
N.B. Emails from this mailing list are arriving erratically. This message is
meant to follow one I sent about half an hour ago but which hasn't been sent
out by the list yet. If this one arrives first, please come back to it after
the first one (subject: 'Find Insertion Point') arrives. Thanks.
On 12/14/00 7:46 PM, I wrote:
>
And I've discovered that it is possible to set the insertion point
>
wherever you want in the document:
>
>
select text from insertion point 1 to insertion point 1 of paragraph
>
16 of window 1
>
>
will put the flashing insertion point right where I want it. But
>
unfortunately, it doesn't seem to "know" this syntax when you ask it for
>
the selection of a flashing insertion point.
>
Actually, it turns out that it _does_ "know" the insertion point syntax. It
works when the insertion point is anywhere other than the beginning of a
blank line. Here's a sample of what I get when the insertion point is at the
of a short line with a blank line following, then another line:
Yours sincerely,| [<-- insertion pt at the pipe]
[sig to be inserted]
-- insertion point 11 of text from word 2 to word 3 of text from
paragraph 18 to paragraph 20 of document "PB HM Hard Disk:Documents:!Form
Letter"
It doesn't really matter that I don't understand that weird syntax. As long
as the script does and can find it again (which it can), that works.
So all I'm looking for now is how to do this at the beginning of a blank
line; maybe there's a way using a try/error block? The fact that an
insertion point somewhere else does NOT error makes it trickier to use my
'placeholder' selected word: if someone forgets to select a word in the
right place, it won't error the script: it will just insert the text I'm
giving it in the wrong place, wherever the insertion point happens to be. I
suppose I could get 'contents of selection', and if the result is "", I'll
enforce an error. But this is getting to be a fairly kludgy workaround.
--
Paul Berkowitz