[sample code] Calling AppleScript from Swift

Belatedly, here’s a demo project showing how to use AppleScript directly from Swift via the AppleScriptObjC framework:


https://github.com/hhas/Swift-AppleScriptObjC


AppleScript-ObjC (ASOC) allows ObjC/Swift code to access AppleScript scripts and handlers much like native Cocoa classes/instances and methods, converting parameters and return values between standard AppleScript data types and Foundation equivalents. While ASOC is neither seamless nor complete, nor a patch on a native Apple event bridge, for non-trivial tasks it’s vastly simpler and way more capable than clunky NSAppleScript/osascript or broken ScriptingBridge framework.


HTH

Replies

Yeah it is fixed since my last comment : I had to take care about the parameter name with the _.


Thx a lot.