Skip to main content
deleted 169 characters in body
Source Link
Matthieu Riegler
  • 22k
  • 11
  • 64
  • 97

Try this

tell application "Firefox" activate tell application "System Events" keystroke "l" using {command down}tab keystroke (key code 125) keystroke (key code 125) keystroke (key code 125) end tell end tell 

You might not need to activate Firefox if it's the current active app. Them you just need :

tell application "System Events" keystroke "l" using {command down}tab keystroke (key code 125) keystroke (key code 125) keystroke (key code 125) end tell 

Since tab is also used to navigate within the page, I replaced it with cmd+l which is the common shortcut to access the bar.

Try this

tell application "Firefox" activate tell application "System Events" keystroke "l" using {command down} keystroke (key code 125) keystroke (key code 125) keystroke (key code 125) end tell end tell 

You might not need to activate Firefox if it's the current active app. Them you just need :

tell application "System Events" keystroke "l" using {command down} keystroke (key code 125) keystroke (key code 125) keystroke (key code 125) end tell 

Since tab is also used to navigate within the page, I replaced it with cmd+l which is the common shortcut to access the bar.

Try this

tell application "Firefox" activate tell application "System Events" keystroke tab keystroke (key code 125) keystroke (key code 125) keystroke (key code 125) end tell end tell 

You might not need to activate Firefox if it's the current active app. Them you just need :

tell application "System Events" keystroke tab keystroke (key code 125) keystroke (key code 125) keystroke (key code 125) end tell 
Source Link
Matthieu Riegler
  • 22k
  • 11
  • 64
  • 97

Try this

tell application "Firefox" activate tell application "System Events" keystroke "l" using {command down} keystroke (key code 125) keystroke (key code 125) keystroke (key code 125) end tell end tell 

You might not need to activate Firefox if it's the current active app. Them you just need :

tell application "System Events" keystroke "l" using {command down} keystroke (key code 125) keystroke (key code 125) keystroke (key code 125) end tell 

Since tab is also used to navigate within the page, I replaced it with cmd+l which is the common shortcut to access the bar.