This thread was archived. Please ask a new question if you need help.
applescript can't get name of front window
The AppleScript support seems broken or unreliable (at least on OSX 10.10.1).
For example, this little, very basic script worked in Firefox 33 but now (34?, 35 or 36) NOT anymore:
tell application "Firefox" name of front window end tell
==> error "plugin-container got an error: Can’t get name of window 1." number -1728 from name of window 1
Hint: If you check the output of the next applescript snippet, you see that the 'windows' don't even get a correct id.
tell application "Firefox" windows end tell
All Replies (12)
A further hint (tested on firefox version 35 and 36):
In the script, application 'Firefox' gets replaced by 'plugin-container' when compiling the script !!!
Have you contacted the real AppleScript support people ?
Where, at Apple or at Firefox?
This is clearly a Firefox issue.
Thank you, Emelin
You are having problems with AppleScript. Are you having problems with anything else? If not, then you should speek to AppleScript support. If you are having other issues, tell us what they are.
Ok Fred, I try again.
1.) Firefox supports AppleScript, at least the very basic functionality. 2.) In Firefox 33 everything works as expected. 3.) I want to get the name of the frontmost window that is open in Firefox. 4.) However, the current Firefox 35 (and devel 36) do not return the name anymore but the error reported above. 5.) This means it should be considered a problem of the newer Firefox versions. 6.) I hinted at the problem by providing my observations that a) the list returned by the 2nd little code snippet I posted would not have ID assigned to the windows as all other OSX applications supporting applescript do; b) the application string "Firefox" in the script is changed to "plugin-container" when the script is compiled by the Apple Script Editor. This replacement did not happen with Firefox 33.
I hope this explains my issue that I cannot get the name of the frontmost window anymore.
By the way, have you ever tried the posted code snippets? Thank you!
Modified by emelin
I don't know code snippets, but there are others who do.
I've called the big guys to help you. Good luck.
"code snippets" is not an application or editor or the like but should have simply refered to the 'little bits of code' I have posted in my 1st mail.
Please excuse my English.
Thank you Fred, for listening and forwarding! Emelin
Hello again, any hope to get an answer on that issue?
Furhter tests (now on the most recent firefox 35.0.1) show, that as soon as the flash plugin get's activated the firefox applescript interface addresses an application named "plugin-container" instead of the supposed application "Firefox"!
As soon as you deactivate the flash plugin permanently and restart firefox, the above posted scripts do behave normally again and as expected.
Yes, I know, Flash proved many times to be the worst plague ever. Still, I am afraid, this issue has to be solved by firefox.
All that is out of my element. But I can give you this;
Update your Flash Player v22.214.171.1246
This just came out.
Sorry Fred, that has no effect.
I can only repeat that this is a problem of firefox.
Can't anybody react to this quite specific and easily reproduced bug-report of mine whose "element" it actually is?
You may be able to find some insight here, however if they are different bugs, then use these bugs as reference for where/what category to file a new one. (also who to cc ;-))
- https://bugzilla.mozilla.org/show_bug.cgi?id=119091-> this one seems to indicate that the name of the app is Mozilla. However they may be interchangible.
Thanks for this more helpful reply.
The bugs hinted at are age-old, but still open. Yet, what's reported there is not my problem.
The name of the app is Firefox as one can gather from https://wiki.mozilla.org/Mac:AppleScript and the recent bugs there. However mine is not covered. So, finally, I will file a bug report.