{"repo":"emorydunn/AppleScriptBridge","free":true,"listed":false,"github":"https://github.com/emorydunn/AppleScriptBridge","clone":"git clone https://github.com/emorydunn/AppleScriptBridge.git","description":"Bridging AppleEvent descriptors with Swift types.","language":"Swift","stars":18,"topics":["appleevent","applescript","automation","macos","swift"],"license":"MIT","category":"workflow-automation","readme_excerpt":"AppleScriptBridge A collection of helpers for dealing with AppleEvents in Swift. This package focuses on bridging NSAppleEventDescriptor with Swift types for easier automation of scriptable applications. AppleEventDescriptorRepresentable A core protocol of the library is AppleEventDescriptorRepresentable , which encapsulates converting between Swift types and AppleEvent descriptors. The is similar to RawRepresentable , allowing initialization from a descriptor and providing a descriptor. Default implementations are provided for many value types that are available from a descriptor: - String - Date - Bool - Double - File URL - Int Conditional conformance is also added for types whose elements are descriptors: - Arrays - Optionals - RawRepresentable NSAppleEventDescriptor There are several initializers on NSAppleEventDescriptor which reduce boilerplate, mostly dealing with constructing lists. NSAppleEventDescriptor(listDescriptor:) handles initializing a list descriptor and adding each item in the array. NSAppleEventDescriptor.missingValue() is also added in addition to .null() . NSAppleScript Throwing Methods Both init and execute have options which will throw instead of requiring a dictionary be passed in: Calling Handlers Calling handlers (methods) in an AppleScript is usually full of boilerplate requiring creating a whole host of other events and descriptors. This has been simplified to a single method: Using AppleEventDescriptorRepresentable However, passing in NSAppleEven","default_branch":null,"files":null,"tree":[],"storefront":"/r/emorydunn","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/emorydunn/AppleScriptBridge/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}