Re: (2 of 2) Application Scripting Question - Theoretical? (was Re: Technote 2106 is da Bomb)
Re: (2 of 2) Application Scripting Question - Theoretical? (was Re: Technote 2106 is da Bomb)
- Subject: Re: (2 of 2) Application Scripting Question - Theoretical? (was Re: Technote 2106 is da Bomb)
- From: Nigel Garvey <email@hidden>
- Date: Mon, 12 Apr 2004 15:10:14 +0100
Michael Terry wrote on Sun, 11 Apr 2004 15:02:57 -0700:
>
On Apr 11, 2004, at 8:17 AM, Nigel Garvey wrote:
>
>
> Michael Terry wrote on Fri, 9 Apr 2004 18:15:26 -0700:
>
>
>
>> set x to 3
>
>> set y to 4
>
>>
>
>> set a to a reference to x
>
>> set b to a reference to y
>
>>
>
>> set contents of {a, b} to {"hello", "there"}
>
>> --> Can't set contents of {x, y} to {"hello", "there"}.
>
>>
>
>
Even look at the error message there: I didn't ask to set the
>
*contents* of {x, y}, but AS does recognize that I wanted to set {x,
>
y}, not {3, 4}. I *asked* to set the contents of {a, b} to {"hello",
>
"there"}.
>
>
contents of {a, b}
>
>
... should return a list of lvalues in this context, wouldn't you say?
'contents of' takes the *value* of {a, b} as its parameter. That value is
{x of <<script>>, y of <<script>>}. The value of the 'contents of'
operation is {3, 4}, but the error message is apparently trying to be
helpful by describing the attempted action. cf:
set a to 1
set b to 2
get fred of {a, b}
--> Can't get fred of {1, 2}
I don't know if it's the same for you, but when I run the 'contents of
{a, b}' script, the displayed error message is: Can't set contents of {x
of <<script>>, y of <<script>>} to {"Hello", "there"}. If I trap the
error in a 'try' block, the message subtly changes to "Can't set contents
of {x, y} to {\"Hello\", \"there\"}." (It's the {x, y} that I'm trying to
point out, not the escaped quotes.)
NG
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.