Created
April 22, 2014 18:50
-
-
Save mndrix/11190207 to your computer and use it in GitHub Desktop.
AppleScript to find the currently focused Google Chrome tab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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