Skip to content

Instantly share code, notes, and snippets.

@lucapette
Created January 30, 2017 20:48
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 lucapette/41607dfd69f45d70059d029b7b41436f to your computer and use it in GitHub Desktop.
Save lucapette/41607dfd69f45d70059d029b7b41436f to your computer and use it in GitHub Desktop.
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