Skip to content

Instantly share code, notes, and snippets.

@jordansaints
Last active December 3, 2024 10:47
Show Gist options
  • Save jordansaints/7028459 to your computer and use it in GitHub Desktop.
Save jordansaints/7028459 to your computer and use it in GitHub Desktop.
An AppleScript script that grabs the URL of the currently open tab in Google Chrome and launches it in Firefox; most convenient when assigned to a keyboard shortcut.
-- Open Chrome's current tab in Firefox
-- by Jordan Saints, www.jordansaints.com
tell application "Google Chrome"
activate
end tell
delay 0.2
tell application "System Events" to key code 37 using {command down} -- cmd+L FOCUS on URL in Chrome
delay 0.1
tell application "System Events" to key code 8 using {command down} -- cmd+C COPY
tell application "Firefox"
activate
end tell
delay 0.5
tell application "System Events" to key code 17 using {command down} -- NEW TAB
delay 0.1
tell application "System Events" to key code 9 using {command down} -- cmd+V PASTE
delay 0.1
tell application "System Events" to key code 36 -- ENTER!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment