Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (14 sloc) 448 Bytes
tell application "System Events"
set numSafari to count (every process whose name is "Safari")
set numChrome to count (every process whose name is "Google Chrome")
end tell
if numSafari > 0 then
tell application "Safari" to get URL of front document
else
if numChrome > 0 then
tell application "Google Chrome"
set frontIndex to active tab index of front window
get URL of tab frontIndex of front window
end tell
end if
end if