i find that i tend to use netnewswire as often as i do safari, both of which use the system-wide flash instance. this applescript checks which of those two is the frontmost application and opens the current url in chrome. i'm an applescript newbie, so any improvements are more than welcome :)
Code: Select all
tell application "LaunchBar" to hide
tell application "System Events" to set currentApplication to name of 1st application process whose frontmost is true
set currentURL to getCurrentURL(currentApplication)
if currentURL is not "" then
tell application "Google Chrome"
if (exists window 1) and (URL of active tab of window 1 is "chrome://newtab/") then
tell window 1 to set URL of active tab to currentURL
open location currentURL
if currentApp = "Safari" then
tell application "Safari" to set currentURL to URL of current tab of window 1
else if currentApp = "NetNewsWire" then
tell application "NetNewsWire"
set allURLs to URLs of tabs
set currentURL to item (index of selected tab + 1) of allURLs
currentURL = ""
if you use other browsers that use the system-wide flash instance, add your applescript code to getCurrentURL(currentApp).