Running a shell script

do shell script "/Path/to/script.sh"


If you want to run it with administrator privileges, append the following:

user name "your_username" password "your_password" with administrator privileges


More info: http://developer.apple.com/library/mac/#technotes/tn2002/tn2065.html

Open a new tab in Safari

tell application "Safari"

activate

set new_tab to make new tab at the end of every tab of front window

set current tab of front window to new_tab

end tell

Open a new window in Safari

tell application "Safari"

activate

make new document

end tell

Open the current Safari document in Google Chrome

This is useful if you don't want Adobe Flash support in Safari, and use Chrome in case you need Flash to view a webpage.

tell application "Safari" to set theURL to the URL in document 1


tell application "Google Chrome"

activate

tell application "System Events" to keystroke "t" using {command down}

set URL of last tab of window 1 to theURL

end tell