Skip to content

Instantly share code, notes, and snippets.

@mndrix
Created April 22, 2014 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mndrix/11190207 to your computer and use it in GitHub Desktop.
Save mndrix/11190207 to your computer and use it in GitHub Desktop.
AppleScript to find the currently focused Google Chrome tab
-- run with `osascript -s s focused-chrome-tab.scpt` to get machine-readable output
tell application "Google Chrome"
set active_window to first window
set i to active tab index of active_window
set active_tab to item i of tabs of active_window
set x to {URL:URL of active_tab, title:title of active_tab}
return x
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment