Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hhas/Swift-AppleScriptObjC
How to call AppleScript handlers from Swift via AppleScript-ObjC bridge.
https://github.com/hhas/Swift-AppleScriptObjC
applescript applescriptobjectivec public-domain swift
Last synced: about 2 months ago
JSON representation
How to call AppleScript handlers from Swift via AppleScript-ObjC bridge.
- Host: GitHub
- URL: https://github.com/hhas/Swift-AppleScriptObjC
- Owner: hhas
- Created: 2018-06-19T01:24:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-01-05T12:50:10.000Z (about 3 years ago)
- Last Synced: 2024-08-10T14:18:33.437Z (5 months ago)
- Topics: applescript, applescriptobjectivec, public-domain, swift
- Language: Swift
- Homepage:
- Size: 19.5 KB
- Stars: 65
- Watchers: 4
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
README
A simple "remote control" for Music.app which demonstrates how to call AppleScript via the AppleScript-ObjC (ASOC) bridge within a Swift-Cocoa app.
Caution: The AppleScript code lacks detailed error reporting and the Swift code's error handling is minimal. The app will fail *silently* if the following requirements are not met:
- The Plist.info file must contain an "NSAppleEventsUsageDescription" entry.
- If Hardened Runtime is enabled, the Apple Events exception in Targets > Signing & Capabilities must be selected.
- If sandboxing is enabled, the appropriate "com.apple.Music.library..." entitlements must be declared.
- The user grants the app Authorization to control Music.app when first prompted by macOS.
This code is released into the public domain.