Created
July 27, 2012 23:18
-
-
Save seanlilmateus/3190992 to your computer and use it in GitHub Desktop.
Safari tabs 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
framework "ScriptingBridge" | |
safari=SBApplication.applicationWithBundleIdentifier("com.apple.Safari") | |
new_window = SafariDocument.alloc.init # create a new window | |
safari.windows << new_window # make the window visible | |
safari.windows.first.currentTab.URL = "https://mail.google.com" | |
sites = ["https://twitter.com", "http://news.ycombinator.com"].map do |site| | |
new_tab = SafariTab.alloc.initWithProperties({"URL" => site}) # create a new tab | |
safari.windows.first.tabs << new_tab # add the tab to the window | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment