-
Notifications
You must be signed in to change notification settings - Fork 289
Open
Description
iTunes is long defunct, and so is its API: #2495
The official way to interact with the music library on macOS is MusicKit: https://developer.apple.com/documentation/applemusicapi/
I have the absolute barest version of a plugin at https://github.com/lgarron/AppleMusic-qsplugin
It:
- Indexes all songs in the library and places them in the catalog.
- Has a "Play" action that can be used to play a song.
This works!
However, it does nothing else useful and still contains boilerplate. In addition:
- This requires adding
NSAppleMusicUsageDescription
toInfo.plist
in Quicksilver itself:Quicksilver/Quicksilver/PropertyLists/Quicksilver-Info.plist
Lines 183 to 192 in 5779b38
<key>NSAppleEventsUsageDescription</key> <string>Quicksilver requires this access to run certain actions and update your catalog.</string> <key>NSAppleScriptEnabled</key> <true/> <key>NSCalendarsUsageDescription</key> <string>Create events directly from Quicksilver (only used when the 'Calendar' plugin is enabled)</string> <key>NSContactsUsageDescription</key> <string>View, copy and paste information from your contacts in Quicksilver (only used when the 'Contacts' plugin is enabled)</string> <key>NSRemindersUsageDescription</key> <string>Create reminders directly from Quicksilver (only used when the 'Calendar' plugin is enabled)</string> - Building with the MusicKit API requires targeting macOS 14 or above. I do not know if it's possible to build the plugin like this without also increasing the target for Quicksilver itself.
- The
MusicKit
API is asynchronous, and interfaces inside Quicksilver are not. I was able to hack around this using a very unadvisable workaround to make synchronous code block on aTask
: https://forums.swift.org/t/using-async-functions-from-synchronous-functions-and-breaking-all-the-rules/59782/4- Given that it takes several seconds to index a music library, it is probably a good idea to have an async API for indexing. But I think that's a much larger architectural change. I don't know the best compromise.
- The song (queue) stops playing when Quicksilver exits. It seems this may be a limitation of the MusicKit API. Given Quicksilver's propensity for crashing I'd really like a workaround, but it seems the only other one is effectively to use AppleScript.
Anyhow, I don't know how much time I can dedicate to this but hopefully my repo shows that it's at least possible to rebuild the functionality of the old iTunes plugin from scratch.
Metadata
Metadata
Assignees
Labels
No labels