Skip to content

Instantly share code, notes, and snippets.

@iceener
Created May 2, 2023 18:32
Show Gist options
  • Save iceener/026bd8938dc5a71444ae4756c4ae6140 to your computer and use it in GitHub Desktop.
Save iceener/026bd8938dc5a71444ae4756c4ae6140 to your computer and use it in GitHub Desktop.
tell application "System Events"
set frontmostApplication to name of first application process whose frontmost is true
set browserName to ""
if frontmostApplication is "Arc" then
tell application "Arc" to return URL of active tab of window 1
else if frontmostApplication is "Google Chrome" then
tell application "Google Chrome" to return URL of active tab of window 1
else if frontmostApplication is "Brave Browser" then
tell application "Brave Browser" to return URL of active tab of window 1
else if frontmostApplication is "Safari" then
tell application "Safari" to return URL of current tab of window 1
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment