Closed
      
        Bug 467697
      
      
        Opened 16 years ago
          Closed 16 years ago
      
        
    
  
AppleScript: can't get index property of windows, AppleEvent handler error  
    Categories
(Camino Graveyard :: OS Integration, defect)
Tracking
(Not tracked)
        RESOLVED
        FIXED
        
    
  
People
(Reporter: lthompson.22, Assigned: alqahira)
Details
(Keywords: regression)
Attachments
(1 file)
| 1.44 KB,
          patch         | peeja
:
              
              review+ mikepinkerton
:
              
              superreview+ | Details | Diff | Splinter Review | 
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
| Assignee | ||
| Comment 1•16 years ago
           | ||
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?
| Assignee | ||
| Comment 2•16 years ago
           | ||
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?
| Assignee | ||
| Comment 3•16 years ago
           | ||
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?
(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
| Assignee | ||
| Updated•16 years ago
           | 
        Attachment #351113 -
        Flags: review? → review?(peter.a.jaros)
| Assignee | ||
| Comment 5•16 years ago
           | ||
Comment on attachment 351113 [details] [diff] [review]
possible fix (works on 10.5)
Eiichi, thanks for testing!
|   | ||
| Updated•16 years ago
           | 
Hardware: Macintosh → All
|   | ||
| Comment 6•16 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+
| Assignee | ||
| Updated•16 years ago
           | 
        Attachment #351113 -
        Flags: superreview?(mikepinkerton)
|   | ||
| Comment 7•16 years ago
           | ||
Comment on attachment 351113 [details] [diff] [review]
possible fix (works on 10.5)
rs=pink
        Attachment #351113 -
        Flags: superreview?(mikepinkerton) → superreview+
| Assignee | ||
| Comment 8•16 years ago
           | ||
Landed on cvs trunk.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
          You need to log in
          before you can comment on or make changes to this bug.
        
Description
•