We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

applescript can't get name of front window

  • 12 回覆
  • 1 有這個問題
  • 1 次檢視
  • 最近回覆由 emelin

more options

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

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

所有回覆 (12)

more options

A further hint (tested on firefox version 35 and 36):

In the script, application 'Firefox' gets replaced by 'plugin-container' when compiling the script !!!

more options

Have you contacted the real AppleScript support people ?

more options

Hello Fred,

Where, at Apple or at Firefox?

This is clearly a Firefox issue.

Thank you, Emelin

more options

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.

more options

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!

Cheers, Emelin

由 emelin 於 修改

more options

I don't know code snippets, but there are others who do.

I've called the big guys to help you. Good luck.

more options

"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

more options

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.

more options

All that is out of my element. But I can give you this;

Update your Flash Player v16.0.0.296
https://www.adobe.com/products/flashplayer/distribution3.html

This just came out.

more options

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?

Thank you!

more options

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 ;-))

more options

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.