Re: Convert first char to lower case
Re: Convert first char to lower case
- Subject: Re: Convert first char to lower case
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 09 Jan 2002 08:53:20 -0800
On 1/9/02 4:55 AM, "Nigel Garvey" <email@hidden>
wrote:
>
> Seems TIDs are very fussy about what they get set to, at least when you do
>
> a lot of it.
>
>
>
> Try this and see if it makes a difference:
>
>
>
> character 1 of Variable1
>
> set AppleScript's text item delimiters to result
>
>
Ah yes. That does seem to make it more stable. It looks like another
>
manifestation of the ol' "reference in a list in a line of the script"
>
problem. The tids were getting set to {character 1 of Variable1} rather
>
than to {"T"}. The reference inside the list has to be resolved first by
>
creating the list with a separate instruction. has's suggestion uses an
>
implicit 'get' command. An explicit one also works:
>
>
set AppleScript's text item delimiters to (get {character 1 of
>
Variable1})
I'm accustomed to this sort of thing in applications I use, and am wondering
if that is the correct explicit get , or if it should be this one instead:
set AppleScript's text item delimiters to {get (character 1 of Variable1)}
I think you may well be right, but it makes me uneasy!
What has actually did, in addition to using an implicit 'get', was remove
the list from the tids entirely and force it to be coerced. Somebody tested
recently and claimed that
set AppleScript's text item delimiters to "a"
actually worked faster than
set AppleScript's text item delimiters to {"a"}
which is the correct terminology. I didn't "like" this result - why should
the wrong terminology work better than the right one, but I don't know how
these things really work "under the hood". Until the day if/when/never
multiple delimiters are introduced, should we really revert back to the
incorrect 'string' from the correct 'list of string'?
--
Paul Berkowitz