[Adium-devl] AppleScript status bug (Trac #8687)
Matt Handley
applmak at gmail.com
Mon Dec 31 15:23:55 UTC 2007
The short: I just created a status and tested this from trunk:HEAD
and it works fine.
The long:
That error shows up when you ask for, say, item 14 of a list that has
only 4 things in it:
tell application "Adium"
set stat to get status 14
get message of stat
end tell
Adium got an error: NSReceiverEvaluationScriptError: 4
However, your code itself, modified slightly for my machine seems to
work fine:
tell application "Adium"
set stat to first status whose title is "Test awesomeness" and type
is away
get message of stat
end tell
"thing" --the correct response
Plus, on my machine, unless I explicitly ask for some index out of
range, as in the first example, I am unable to generate the same
error message. So, I suspect it has something to do with the statuses
in your copy of Adium. What are they, and how did you make them
(using the Custom... line? Using the Edit Statuses menu?, etc...)
Matt
On Dec 31, 2007, at 9:07 AM, David Symonds wrote:
> On Jan 1, 2008 1:59 AM, Evan Schoenberg <evan.s at dreskin.net> wrote:
>>
>>
>> On Dec 31, 2007, at 12:11 AM, David Symonds wrote:
>> However, applying that to statuses doesn't: [#2]
>> tell application "Adium"
>> set stat to first status whose title is "Home" and type is away
>> get message of stat
>> end tell
>> This fails with an error saying: "Adium got an error:
>> NSReceiverEvaluationScriptError: 4"
>>
>> Oddly enough, rephrasing it slightly works just fine: [#3]
>> tell application "Adium"
>> get message of first status whose title is "Home" and type is away
>> end tell
>>
>>
>> I can't run either of these, before or after r22078, because
>> Applescript
>> complains:
>> "Adium got an error: Can't make type into type specifier."
>>
>> What are you doing to get around that / do you have any idea
>> what's wrong?
>
> I would suspect _your_ error message is coming from the "and type is
> away" bit at the end of the lines, which is unrelated to my problem.
> You can quite happily remote that bit to reproduce the error I'm
> tripping over, with:
> tell application "Adium"
> set stat to first status whose title is "Home"
> get message of stat
> end tell
>
>> It could be completely unrelated, but the 'id' property of the status
>> class is declared as 'text', whereas the 'id' properties of other
>> classes (window, account) are declared as 'integer'. Could that be
>> the
>> reason? The chat class is a notable exception: its 'id' property is
>> also 'text'.
>> It could be completely related - that's a good catch. Try
>> changing it to
>> "integer" and let us know if it fixes the problem :)
>
> As Matt said, it probably shouldn't make a difference, but I can try
> that if no-one else has any better ideas. I'm still fairly weak in my
> AppleScript internals understanding, so I'm just wildly guessing here,
> but would it be worth comparing the definitions of the status class
> (which is failing) with the account class (which is working) to narrow
> down the problem?
>
>
> Dave.
>
> _______________________________________________
> Adium-devl mailing list
> Adium-devl at adiumx.com
> http://adiumx.com/mailman/listinfo/adium-devl_adiumx.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20071231/8aa120f7/attachment-0001.html>
More information about the devel
mailing list