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


Click here to return to the 'opening URL's from the command line' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
opening URL's from the command line
Authored by: jaysoffian on Apr 05, '02 05:14:23AM

Here's how I open URL's from the command line. In ~/bin, I have a simple script
I named xurl. Thus, ~/bin/xurl is:

1 #!/bin/sh
2 cat <<. | /usr/bin/osascript
3 tell application "$1"
4 OpenURL "$2"
5 end tell
6 .

I can then type at the shell prompt:

% xurl mozilla http://www.macosxhints.com

or

% xurl "internet explorer" http://www.google.com

(I actually use this script primarily with the xchat IRC client
which allows you to right click on URL's and then choose items
from a customized menu - so I can select IE or Mozilla from that
pull down menu. If pine doesn't allow this flexibilty, then just
hardcode the browser in place of "$1" in the script and change $2
to $1).




[ Reply to This | # ]
opening URL's from the command line
Authored by: DAC on Apr 06, '02 01:56:08PM

I tried this a bit before I published my hints (the ones being commented on), and it does look like a cleaner solution. I may change my system over to match this one. But I had some trouble getting OmniWeb to take the script the same way as IE, so I have not moved over yet. I sometimes also use "odd " browsers that do not like this sort of script. Still, it is much cleaner than the one I made :).

DAC



[ Reply to This | # ]