Open URL and Activate Google Chrome via Applescript

tell application "Google Chrome"
    open location "http://WEBSITEHERE.com"
end tell

osascript -e 'tell application "Google Chrome" to open location "http://yourlink.com.html"'


Try it this way:

tell application "Google Chrome"
    if it is running then
        quit
    else
        activate
        open location "http://xfinitytv.comcast.net"
        delay 1
        activate
    end if
end tell



Note: it's using the newer "Enhanced Application Model" (second line), more info here:
How to check in AppleScript if an app is running, without launching it - via osascript utility

Tags:

Applescript