Created
January 30, 2017 20:48
-
-
Save lucapette/41607dfd69f45d70059d029b7b41436f to your computer and use it in GitHub Desktop.
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
tell application "System Events" | |
set frontApp to name of first application process whose frontmost is true | |
set activeURL to "" | |
if frontApp is "Google Chrome" then | |
tell application "Google Chrome" | |
set normalWindows to (windows whose mode is not "incognito") | |
if length of normalWindows is greater than 0 then | |
set activeURL to (get URL of active tab of (first item of normalWindows)) | |
end if | |
end tell | |
end if | |
end tell | |
frontApp & "," & (activeURL) as String |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment