Jump to content

Open URL's action in new Chrome Window?


Recommended Posts

Im creating a workflow to launch a new Chrome browser window and open a group of sites. Is there anyway to launch a new window and then execute the 'open url' actions? I thought maybe 'keyword->applescript->open url would do the trick but I cant link these together. Any help much appreciated.

Link to comment
  • 2 weeks later...

I think SBScriptingBridge and a little python would do the trick :)

Here's a little code to get you started:

 

from Foundation import *
from ScriptingBridge import *

#http://www.mugginsoft.com/html/kosmictask/ScriptingBridgeDox/Google/Google-Chrome/OS-X-10.7/Google-Chrome-19.0.1084.56/html/_google-_chrome_8h_source.html

chrome = SBApplication.applicationWithBundleIdentifier_("com.google.chrome")

newWindow = chrome.classForScriptingClass_("window").alloc().init()

chrome.windows().addObject_(newWindow)

firstTab = newWindow.tabs().objectAtIndex_(0)

firstTab.setURL_("http://www.alfredforum.com")

newTab = chrome.classForScriptingClass_("tab").alloc().init()

newWindow.tabs().addObject_(newTab)

newTab.setURL_("http://www.google.com")
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...