on open location the_url
tell application "System Events"
set browser_apps to the name of every process whose visible is true
if "Opera" is in browser_apps then
tell application "Opera"
open location the_url
activate
end tell
else if "firefox-bin" is in browser_apps then
tell application "Firefox"
open location the_url
activate
end tell
else if "Google Chrome" is in browser_apps then
tell application "Google Chrome"
open location the_url
activate
end tell
else
tell application "WebKit"
open location the_url
activate
end tell
end if
end tell
end open location