tamagoshi Posted February 13, 2013 Posted February 13, 2013 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.
Thoro Posted February 25, 2013 Posted February 25, 2013 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")
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now