Re: change case script
Re: change case script
- Subject: Re: change case script
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 03 Nov 2001 20:52:43 -0800
On 11/3/01 8:28 PM, "Bill Briggs" <email@hidden> wrote:
>
At 11:28 AM -0800 03/11/01, Paul Berkowitz wrote:
>
> On 11/3/01 11:07 AM, "Arthur J Knapp" <email@hidden> wrote:
>
>
>
>> When I write handlers, I try to always use the save, set, and restore
>
>> technique for tids, because I don't like to make any assumtions about
>
>> what the "main" calling script is doing with the delimiters, but when
>
>> I post "top-level" bits of code, I'm never sure what the best way to
>
>> deal with the tids is.
>
>
>
>
>
> My own policy, taken over from JD of yore, is to restore {""}. I myself do
>
> it specifically to help out users who don't know about this stuff and may
>
> have their tids in a twist due to somebody else's script not restoring the
>
> default correctly. I would not do this in any script meant to run
>
> from from a scripter's script editor where other work may be in
>
> progress.
>
>
Sadly, since AppleScript isn't multi-threaded, not even in X, this
>
isn't likely to be a problem (other work can't be in progress). I
>
wish it was a problem.
>
"In progress" in the sense that a scripter might be working on other
scripts, runs this one which changes tids without restoring them, then goes
back to working on the other script(s) with strange results. I myself had
this occur to me a few times when a script-editor-that-shall-be-nameless set
tids to {":"} as part of one of its own initialization procedures and did
not restore them. When I used any lists "as string" in my own scripts, very
strange things appeared: entire pages filled with colons. Said script editor
is now very well-behaved. (If you check its initialization routine that
requires the {":"} tids, you will find that it is now followed by a
restoring handler and commented "in case the TIDS police are watching". That
must have been me, I think.)
--
Paul Berkowitz