Skip to content

Instantly share code, notes, and snippets.

@seanlilmateus
Created June 24, 2012 06:25
Show Gist options
  • Save seanlilmateus/2981945 to your computer and use it in GitHub Desktop.
Save seanlilmateus/2981945 to your computer and use it in GitHub Desktop.
create a new incognito window in Google Chrome with MacRuby
#!/usr/bin/env macruby -wKU
framework 'ScriptingBridge'
chrome = SBApplication.applicationWithBundleIdentifier("com.google.Chrome")
SBApplication.ensureScriptingAdditionsLoaded
# create a new window with size of 600x600 px
chrome.windows << GoogleChromeWindow.alloc.initWithProperties( mode: "incognito", bounds: [1, 22, 600, 600] )
# first tab load macruby.org
chrome.windows.first.tabs.first.URL = "http://macruby.org/"
# bring chrome to the front
chrome.frontmost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment