Re: Dialects (ReallyTex-Edit Question)
Re: Dialects (ReallyTex-Edit Question)
- Subject: Re: Dialects (ReallyTex-Edit Question)
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 14 Nov 2000 13:25:20 -0800
On 11/14/00 5:19 AM, "Xandra Lee" <email@hidden> wrote:
>
> On 11/13/00 9:27 AM, I wrote:
>
>
>
>> tell document 1
>
>> set size of character 1 of (every line whose contents = return) to 4
>
>> end tell
>
>
>
Paul,
>
>
this worked like a charm.
I'm glad.
>
Thanks also for the repeat syntax tip.
Actually, it won't usually make much difference when you're just counting
items of an applescript list, as you were doing. That's always very fast,
even when there are a lot of items. The place where it makes a huge
difference is where it has to keep recounting application objects, since
that involves more AppleEvents. I once saw the time it took a script to
'repeat with i from 1 to count (every contact)' in Outlook Express drop from
over a minute to under a second by setting a variable, so it is a good habit
to get into.
>
>
I'm curious about what exactly caused the change from v3 to v4 (since
>
it's likely I have this sort of construct in other scripts)
>
>
I still SUSPECT that in v3
>
> (every paragraph of document 1 whose length = 0)
>
was returning a reference to the paragraphs (as I can't see how the
>
original would have worked otherwise) whereas v4 seems to be returning
>
contents.
>
I think that v3 must have had a funny coercion that actually allowed 'size
of character 1 of paragraph 5' to be set, even where paragraph 5 = "". In
other words, it let you set the size of a blank line as in the UI. But it
was poor applescripting, not following the object model, since a paragraph
consisting of "" HAS no character 1,so it's right that they changed it. I
recall now that they do have a number of what I called "facilitations" in
TE+ which allow errors to be quietly passed over instead of stopping the
script with an error message, and that is apparently what's now happening
when you try this.
--
Paul Berkowitz