Created
November 4, 2015 03:24
-
-
Save jonathanstiansen/83bdd6f9cc2297f1e9ad to your computer and use it in GitHub Desktop.
This is how one
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
// Examples are: "tell application \"Google Chrome\" to return URL of front document" | |
// Other web app specific versions here: https://gist.github.com/vitorgalvao/5392178 | |
let myAppleScript = "..." | |
var error: NSDictionary? | |
if let scriptObject = NSAppleScript(source: myAppleScript) { | |
if let output: NSAppleEventDescriptor = scriptObject.executeAndReturnError(&error) { | |
if let result = output.stringValue { | |
print(output.stringValue) | |
} | |
} else if (error != nil) { | |
print("error: \(error)") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment