Created
February 22, 2010 15:07
-
-
Save rociiu/311135 to your computer and use it in GitHub Desktop.
macruby script that get the current browsing web url from safari
This file contains hidden or 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
# macruby script that get the current browsing web url from safari | |
apple_script = <<-APPLESCRIPT | |
tell application "Safari" | |
set a to URL of front document as string | |
return a | |
end tell | |
APPLESCRIPT | |
script = NSAppleScript.alloc.initWithSource(apple_script) | |
result = script.executeAndReturnError(nil) | |
result.stringValue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment