Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Use AppleScripts to send URLs from browser to browser' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use AppleScripts to send URLs from browser to browser
Authored by: adamh on Mar 30, '06 10:32:27PM
Great script.

I've simplified it a bit and put it into one script so you can choose the brower(s) to target from a dialog, instead of having to bind so may keys to seperate scripts.
set browserTargets to {"camino", "safari", "internet explorer", "firefox", "opera"}

tell application "System Events"
	set myApp to name of first application process whose frontmost is true
	if myApp is "Camino" then
		tell application "Camino" to set myURL to URL of window 1
	else if myApp is "firefox-bin" then
		tell application "Firefox" to set myURL to «class curl» of window 1
	else if myApp is "Opera" then
		tell application "Opera" to set myURL to item 1 of (GetWindowInfo of window 1)
	else if myApp is "Safari" then
		tell application "Safari" to set myURL to URL of document 1
	else if myApp is "Internet Explorer" then
		tell application "Internet Explorer" to set myURL to do script "window.location;"
	else
		return
	end if
end tell

tell application myApp
	activate
	set targetBrowser to choose from list browserTargets with title "Open URL in Browser" with prompt myURL with multiple selections allowed without empty selection allowed
end tell

if (targetBrowser is not false) then
	repeat with i from 1 to count of targetBrowser
		set tb to item i of targetBrowser
		do shell script "open -a " & quoted form of tb & " " & quoted form of myURL
	end repeat
end if

Couldn't get the opera code to work on my machine (v8.52) even with plist mod though?

[ # ]
Use AppleScripts to send URLs from browser to browser
Authored by: ra5ul on Mar 31, '06 08:01:17AM
i've only tested it on opera 9.x (on tiger).

i forgot to mention that the dictionary for opera (and i.explorer 5.2.3, which also required the .plist mod.) didn't show up until i rebuilt the launchservices database. you could always give that a try.

[ # ]