X
Tap here to go to the mobile version of the site.

منتدى الدعم

applescript can't get name of front window

Posted

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

Additional System Details

Installed Plug-ins

  • Provides information about the default web browser
  • Displays Java applet content, or a placeholder if Java is not installed.
  • The QuickTime Plugin allows you to view a wide variety of multimedia content in web pages. For more information, visit the QuickTime Web site.
  • Shockwave Flash 16.0 r0

Application

  • Firefox 36.0
  • User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:36.0) Gecko/20100101 Firefox/36.0
  • Support URL: https://support.mozilla.org/1/firefox/36.0/Darwin/en-US/

Extensions

  • 1Password 4.2.5 (onepassword4@agilebits.com)
  • Abbreviations for Zotero 1.0.189 (abbreviations-for-zotero@mystery-lab.com)
  • Adblock Plus 2.6.7 ({d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d})
  • Apollo Sync for Firefox 2.0.1 (ffsync@apollobrowser.com)
  • AutoPager 0.8.0.10 (autopager@mozilla.org)
  • DownloadHelper 4.9.24 ({b9db16a4-6edc-47ec-a1f4-b86292ed211d})
  • DownThemAll! 2.0.17 ({DDC359D1-844A-42a7-9AA1-88A850A938A8})
  • Firebug 2.0.7 (firebug@software.joehewitt.com)
  • Item History for Zotero 1.0.65 (zotero-item-history@mystery-lab.com)
  • keyconfig 20110522 (keyconfig@dorando)
  • MozRepl 1.1.2 (mozrepl@hyperstruct.net)
  • Paper Machines 0.4.9 (papermachines@chrisjr.org)
  • RTF/ODF Scan for Zotero 1.0.22 (rtf-odf-scan-for-zotero@mystery-lab.com)
  • Zotero 4.0.25.2 (zotero@chnm.gmu.edu)
  • Zotero Auto Index Plugin 0.0.33 (auto-index@iris-advies.com)
  • Zotero automatic export 1.1.8 (zotero-autoexport-bib@rokdd)
  • Zotero autotranslating 1.1.2 (webopac2zotero@rokdd)
  • Zotero Better Bib(La)Tex 0.7.5 (better-bibtex@iris-advies.com)
  • Zotero Bibliography Locale Switcher 1.0 (zotbiblioswitchlocal@somwhere.org)
  • Zotero LibreOffice Integration 3.5.9 (zoteroOpenOfficeIntegration@zotero.org)
  • Zotero Plugin to get date from last-modified 0.0.8 (date-from-last-modified@iris-advies.com)
  • Zotero Report Customizer 0.2.5 (report-customizer@iris-advies.com)
  • Zotero Scholar Citations 1.8.8 (zoteroscholarcitations@beloglazov.info)
  • Zotero Storage Scanner Plugin 0.0.15 (storage-scanner@iris-advies.com)
  • Zotero-to-BibDesk auto-import utility 2.0.6 (zot2bib@mackerron.com)
  • ZoteroQuickLook 1.3.1 (zoteroquicklook@gmail.com)
  • zotxt 0.1.17 (zotxt@e6h.org)
  • Zutilo Utility for Zotero 1.2.10 (zutilo@www.wesailatdawn.com)
  • Adobe Acrobat - Create PDF 1.1 (web2pdfextension@web2pdf.adobedotcom) (Inactive)
  • Context Search X 0.4.6.21 (contextsearch2@lwz.addons.mozilla.org) (Inactive)
  • Download Youtube Videos + 12.9.6 (video.downloader.plugin@ffpimp.com) (Inactive)
  • Extended Copy Menu (fix version) 1.6.1c (extended.copy.menu@fix.version) (Inactive)
  • Extended Statusbar 2.0.3 ({daf44bf7-a45e-4450-979c-91cf07434c3d}) (Inactive)
  • Flash Video Downloader - YouTube HD Download [4K] 6.9.3 (artur.dubovoy@gmail.com) (Inactive)
  • Garmin Communicator 4.1.0 ({195A3098-0BD5-4e90-AE22-BA1C540AFD1E}) (Inactive)
  • Pocket 3.0.6 (isreaditlater@ideashower.com) (Inactive)
  • Readability 2.4 (readability@readability.com) (Inactive)
  • SEASR Analytics for Zotero 0.4.7 (zotero@seasr.org) (Inactive)
  • Torbutton 1.4.6.3 ({e0204bd5-9d31-402b-a99d-a6aa8ffebdca}) (Inactive)
  • Translator 3.1 Community Toolbar 3.21.0.1 ({3eec3c07-13c6-4b41-87c6-40b425a0b0a2}) (Inactive)
  • Xmarks 4.3.5 (foxmarks@kei.com) (Inactive)
  • YouTube quality manager 1.2 (youtubequality@rzll) (Inactive)
  • ZotFile 4.1.1 (zotfile@columbia.edu) (Inactive)

Javascript

  • incrementalGCEnabled: True

Graphics

  • adapterDescription:
  • adapterDeviceID: 0x6720
  • adapterDrivers:
  • adapterRAM:
  • adapterVendorID: 0x1002
  • driverDate:
  • driverVersion:
  • info: {u'AzureCanvasBackend': u'quartz', u'AzureFallbackCanvasBackend': u'none', u'AzureContentBackend': u'quartz', u'AzureSkiaAccelerated': 0}
  • numAcceleratedWindows: 1
  • numTotalWindows: 1
  • webglRenderer: ATI Technologies Inc. -- AMD Radeon HD 6970M OpenGL Engine
  • windowLayerManagerRemote: True
  • windowLayerManagerType: OpenGL

Modified Preferences

Misc

  • User JS: No
  • Accessibility: No

Helpful Reply

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

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

A further hint (tested on firefox version 35 and 36): In the script, application 'Firefox' gets replaced by 'plugin-container' when compiling the script !!!
FredMcD
  • Top 10 Contributor
4248 solutions 59418 answers

Have you contacted the real AppleScript support people ?

Have you contacted the real AppleScript support people ?

Question owner

Hello Fred,

Where, at Apple or at Firefox?

This is clearly a Firefox issue.

Thank you, Emelin

Hello Fred, Where, at Apple or at Firefox? This is clearly a Firefox issue. Thank you, Emelin
FredMcD
  • Top 10 Contributor
4248 solutions 59418 answers

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.

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.

Question owner

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

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

Modified by emelin

FredMcD
  • Top 10 Contributor
4248 solutions 59418 answers

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

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

I don't know code snippets, but there are others who do. I've called the big guys to help you. Good luck.

Question owner

"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

"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

Question owner

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.

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.
FredMcD
  • Top 10 Contributor
4248 solutions 59418 answers

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.

All that is out of my element. But I can give you this; Update your Flash Player '''v16.0.0.296<br>https://www.adobe.com/products/flashplayer/distribution3.html''' This just came out.

Question owner

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!

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!
guigs 1072 solutions 11697 answers

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

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=516502] *[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.

Question owner

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.

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.