Last Comment Bug 464701 - (pierotokou) AppleScript access to window name and other properties
: AppleScript access to window name and other properties
Status: VERIFIED DUPLICATE of bug 427448
Product: Core
Classification: Components
Component: Widget: Cocoa (show other bugs)
: unspecified
: PowerPC Mac OS X
-- enhancement with 3 votes (vote)
: ---
Assigned To: Josh Aas
: Markus Stange [:mstange]
Depends on:
  Show dependency treegraph
Reported: 2008-11-13 08:10 PST by pierotokou
Modified: 2008-11-20 19:14 PST (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image pierotokou 2008-11-13 08:10:44 PST
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; fr; rv: Gecko/2008102920 Firefox/3.0.4
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; fr; rv: Gecko/2008102920 Firefox/3.0.4

window name returns random value in appleScript, if you have accessed other window properties before such as «class curl».
Window properties  are not available any more if you use :
tell application "Firefox" to activate.
And thus until next restart of Firefox

Reproducible: Always

Steps to Reproduce:
1.tell application "Firefox" to return ( name of front window)
2.tell application "Firefox" to return («class curl» of front window)
3.tell application "Firefox" to activate
Actual Results:  
if you run step 1, it will work fine, then step 2 will return an error. if you restart Firefox and run step 2 first, it will return the url. if you try step 1 after after step 2, step 1 will return an error. If you run step 3, step 1 will work fine again but not step 2 ....

Expected Results:  
A reliable support of AppleScript in Firefox. AppleScript is very usefull to Mac developers, this is the only reason while Safari is yet more popular to Mac users than Firefox.
Comment 1 User image Steven Michaud [:smichaud] (Retired) 2008-11-20 15:53:06 PST
This bug report isn't very clear, so I can't test most of it.

But there is one part I can reliably reproduce:

1) Start Firefox 3.0.4.

2) Start Apple's Script Editor (/Applications/AppleScript/Script

3) Paste the following into top part of the Script Editor window, then
   click on the Run button:

   tell application "Firefox" to return (name of front window)

   Each time you do this, a different string of apparently random text
   will appear in the bottom part of the Script Editor's window.

With Firefox you get the correct results (the string in the
front window's titlebar).

With today's Minefield nightly you always get an empty string.

I tested on OS X 10.5.5.
Comment 2 User image Smokey Ardisson (offline for a while; not following bugs - do not email) 2008-11-20 19:13:04 PST

*** This bug has been marked as a duplicate of bug 427448 ***

Note You need to log in before you can comment on or make changes to this bug.