Created
June 24, 2012 06:25
-
-
Save seanlilmateus/2981945 to your computer and use it in GitHub Desktop.
create a new incognito window in Google Chrome with MacRuby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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