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


Click here to return to the 'A one-liner replacement' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A one-liner replacement
Authored by: THEM on Nov 19, '03 01:11:24PM
Replace all that with one line
open location \"http://www.google.com/search?hl=en&q=\" & (the clipboard)
--- -- The preceding message does not represent the views of the sender.

[robg adds: I edited the above code string to format properly in the What's New box...]

[ Reply to This | # ]
A one-liner replacement
Authored by: DougAdams on Nov 19, '03 02:12:49PM
This will work in Panther and Jaguar:

set theURL to open location "http://www.google.com/search?hl=en&q=" & (the clipboard)

try -- Jaguar default browser
	tell application "Finder"
		open location theURL
	end tell
on error -- Panther default browser
	open location theURL
end try


[ Reply to This | # ]
Oops...
Authored by: DougAdams on Nov 19, '03 02:15:33PM
My error.

set theURL to "http://www.google.com/search?hl=en&q=" & (the clipboard)

try -- Jaguar default browser
        tell application "Finder"
                open location theURL
        end tell
on error -- Panther default browser
        open location theURL
end try


[ Reply to This | # ]
Oops...
Authored by: THEM on Nov 19, '03 02:20:32PM

open location is in the standard additions, shouldn't need to be wrapped in a tell block.

---
--
The preceding message does not represent the views of the sender.



[ Reply to This | # ]
Oops...
Authored by: DougAdams on Nov 19, '03 04:25:56PM
open location is in the standard additions, shouldn't need to be wrapped in a tell block.

Of course you are correct. My example was from memory; from a situation where the default browser wouldn't activate in Jaguar unless the tell block was used.

[ Reply to This | # ]