X
Tap here to go to the mobile version of the site.
An updated version of Firefox is available to address the issues with Add-ons disabled or fail to install on Firefox. You can download the update for your OS here: https://www.mozilla.org/firefox/new/ For Known Issues and Workarounds, please check out the update at https://support.mozilla.org/kb/add-ons-disabled-or-fail-to-install-firefox

Support Forum

How to AppleScript closing current tab of front window?

Posted

What is the AppleScript command to simply close the currently displayed tab of the front window?

What is the AppleScript command to simply close the currently displayed tab of the front window?

Chosen solution

I can't hold out high hopes: adding more AppleScript support has been on in the bug tracking system for 17+ years and doesn't seem to have any momentum. Probably your best bet for now is to find hacks other people have posted rather than waiting for a more complete API on Firefox's side.

Read this answer in context 0
Quote

Additional System Details

Installed Plug-ins

  • Shockwave Flash 32.0 r0

Application

  • User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:66.0) Gecko/20100101 Firefox/66.0

More Information

jscher2000
  • Top 10 Contributor
8315 solutions 68040 answers

Helpful Reply

How does AppleScript work? Can it emulate keyboard action? The keyboard shortcut to close the current tab is Command+w (on Windows, it's Ctrl+w).

How does AppleScript work? Can it emulate keyboard action? The keyboard shortcut to close the current tab is '''Command+w''' (on Windows, it's Ctrl+w).
Was this helpful to you? 1
Quote

Question owner

This works but it's not ideal:

tell application "Firefox" to activate tell application "System Events" to keystroke "w" using command down

A more complete AppleScript dictionary for Firefox would be the preferred solution.

This works but it's not ideal: tell application "Firefox" to activate tell application "System Events" to keystroke "w" using command down A more complete AppleScript dictionary for Firefox would be the preferred solution.
Was this helpful to you?
Quote
jscher2000
  • Top 10 Contributor
8315 solutions 68040 answers

GRobLewis said

A more complete AppleScript dictionary for Firefox would be the preferred solution.

Where would that come from?

''GRobLewis [[#answer-1216126|said]]'' <blockquote> A more complete AppleScript dictionary for Firefox would be the preferred solution. </blockquote> Where would that come from?
Was this helpful to you? 0
Quote

Question owner

AppleScript support is compiled into a Mac application.

AppleScript support is compiled into a Mac application.
Was this helpful to you?
Quote
jscher2000
  • Top 10 Contributor
8315 solutions 68040 answers

Chosen Solution

I can't hold out high hopes: adding more AppleScript support has been on in the bug tracking system for 17+ years and doesn't seem to have any momentum. Probably your best bet for now is to find hacks other people have posted rather than waiting for a more complete API on Firefox's side.

I can't hold out high hopes: adding more AppleScript support has been on in the bug tracking system for 17+ years and doesn't seem to have any momentum. Probably your best bet for now is to find hacks other people have posted rather than waiting for a more complete API on Firefox's side.
Was this helpful to you?
Quote
Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.