Re: TE+ question
Re: TE+ question
- Subject: Re: TE+ question
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 31 Oct 2000 11:09:39 -0800
On 10/31/00 10:26 AM, "Marc K. Myers" <email@hidden> wrote:
>
> When I say
>
>
>
> get offset of "CAT4" in document 1
>
>
>
> it also errors. According to TE+'s dictionary,
>
>
>
> offset integer [r/o] -- the offset from the beginning of the document,
>
> in characters
>
>
>
> so I'm not sure what's wrong here. Does anyone?
>
>
>
You're confusing AppleScript's offset (string in a string) with TE+'s
>
offset (text element in a text element). You can get the offset of
>
"word 3" or "paragraph 6", but you can't get the offset of the string
>
"CAT4". If you want the offset of a string you have to "find" it first
>
and then get the offset of the selection:
>
>
tell application "Tex-Edit Plus"
>
search document 1 looking for "CAT4"
>
set x to the offset of the selection
>
end tell
Actually, I wasn't really confusing it. I specifically said that I wanted
to know how TE's offset worked, and that I knew it WASN'T the Standard
Additions offset. I realize that my first post was all wrong (and did
confuse the two things, unnecessarily and unfortunately - a red herring,
sorry), and that's why I sent the second post, which you quoted above.
Thanks very much for your reply. TE's offset evidently needs 'selection',
rather than 'document 1' or 'window 1'. That's the key. Many thanks.
--
Paul Berkowitz