Created
July 8, 2009 03:08
-
-
Save kbrock/142530 to your computer and use it in GitHub Desktop.
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
# Apple Script to open google in a new tab | |
# tell application "Safari" | |
# make new document | |
# set URL of first document to "http://www.google.com" | |
# end tell | |
# rb-appscript to do the same | |
# app("Safari").make(:new => :document) | |
# app("Safari").documents[1].URL.set("http://www.google.com") | |
# MacRuby code to use the ScriptingBridge to do the same | |
framework 'ScriptingBridge' | |
require 'hotcocoa' | |
include HotCocoa | |
safari = SBApplication.applicationWithBundleIdentifier('com.apple.Safari') | |
#safari.make(:new=> :document) # <-- FAIL | |
safari.documents.first.URL='http://www.google.com' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment