Skip to content

Instantly share code, notes, and snippets.

View Rajan's full-sized avatar

rajan Rajan

View GitHub Profile
0xa421Bf037B6CC94A7AFce13B63D403233Ed3d67B
@Rajan
Rajan / gist:f5642833a68a8d964b50218454d813d3
Created September 14, 2016 05:32 — forked from odrobnik/gist:e8ac59e13b62ea80b623
Calling AppleScript from Swift App, passing a parameter
// Swift version of https://developer.apple.com/library/mac/technotes/tn2084/_index.html
@IBAction func testButtonPushed(sender: AnyObject) {
let URL = NSBundle.mainBundle().URLForResource("SendFinderMessage", withExtension: "scpt")!
var errors: NSDictionary?
let script = NSAppleScript(contentsOfURL: URL, error: &errors)!