#!/bin/sh
# http://www.macosxhints.com/article.php?story=20040623231530448

if [  "$1" = "version" ]
	then 
	echo "firesite v 0.1, a duusscript, from http://www.macosxhints.com/article.php?story=20040623231530448 "
	exit 1;
elif [ "$1" = "a" -o "$1" = "activate" ]
	then
	_plus=activate
	shift
elif [ "$1" = "h" -o "$1" = "help" ]
	then
	echo "firesite URL (firesite <(a)ctivate> URL also brings firefox to the front"
	exit 1;
	else
	_plus=""
fi
_url=$1
if [[ "$_url" != http:* ]]
	then
	if [[ "$_url" != file:* ]]
		then
		_url=http://${_url}
	fi
fi
echo url: $_url
echo | osascript <<EOF
tell application "Firefox"
  	Get URL "$_url"
	${_plus}
end tell
EOF

