AppleScript: can't get index property of windows, AppleEvent handler error

RESOLVED FIXED

Status

Camino Graveyard
OS Integration
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: Lisa Thompson, Assigned: Smokey Ardisson (offline for a while; not following bugs - do not email))

Tracking

({regression})

Details

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en; rv:1.9.0.6pre) Gecko/2008120200 Camino/2.0b1pre (like Firefox/3.0.6pre)
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en; rv:1.9.0.6pre) Gecko/2008120200 Camino/2.0b1pre (like Firefox/3.0.6pre)

Any attempt to retrieve the value of a window's index property returns an "AppleEvent handler failed" error.



Reproducible: Always

Steps to Reproduce:
1. Create and run an applescript with, for example, either of the following statements in a tell application "Camino" block:
  get index of window 1
  return index of window "<valid window name>"

Actual Results:  
returns error message: "Camino got an error: AppleEvent handler failed."

Expected Results:  
should return the appropriate index value of the specified window
Peter, this works in 1.6.x and other apps but fails in 2.0.foo (using either "window" or "browser window"); any idea what might be the source of breakage, other than the awesome sdef format?
URL: n/a
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Actually, given the fun the last time we messed with the .sdef, does this work right now on 10.4, or is it broken there, too?
Created attachment 351113 [details] [diff] [review]
possible fix (works on 10.5)

This patch fixes reading the index for me on 10.5.5.  Peter's notes ftw.

Both

tell application "Camino"
     get index of window 1
end tell

and 

tell application "Camino"
     get index of window "Camino. Start"
end tell

work properly (assuming the active tab in one window is http://caminobrowser.org/start/).

Eiichi, can you apply this patch on 10.4 and tell me if these scripts work?
Assignee: nobody → alqahira
Status: NEW → ASSIGNED
Attachment #351113 - Flags: review?

Comment 4

9 years ago
(In reply to comment #3)
> Eiichi, can you apply this patch on 10.4 and tell me if these scripts work?

I tested on 10.4.11.

1) Script 1
tell application "Camino"
     get index of window 1
end tell

-Without the patch -> Camino got an error: NSinternalScriptError
-Applied the patch -> Result 1


2) Script 2
tell application "Camino"
     get index of window "Camino. Start"
end tell

-Without the patch -> Camino got an error: NSinternalScriptError
-Applied the patch -> Result 1
Attachment #351113 - Flags: review? → review?(peter.a.jaros)
Comment on attachment 351113 [details] [diff] [review]
possible fix (works on 10.5)

Eiichi, thanks for testing!

Updated

9 years ago
Hardware: Macintosh → All

Comment 6

9 years ago
Comment on attachment 351113 [details] [diff] [review]
possible fix (works on 10.5)

Looks good to me, and works like a charm.

> <!-- the type is supposed to be "integer" -->

Best comment ever.
Attachment #351113 - Flags: review?(peter.a.jaros) → review+
Attachment #351113 - Flags: superreview?(mikepinkerton)
Comment on attachment 351113 [details] [diff] [review]
possible fix (works on 10.5)

rs=pink
Attachment #351113 - Flags: superreview?(mikepinkerton) → superreview+
Landed on cvs trunk.
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.