MusicBridge
final class MusicBridge
The Music Bridge class; send AppleScript actions to Music
-
AppleScriptObjC object for communicating with Music
Declaration
Swift
private var bridge: MusicBridgeProtocol -
AppleScriptObjC setup
Declaration
Swift
init() -
Get the AppleScript ID for a song
Note
Persistent ID between AppleScript and iTunesLibrary do not match so we have to search by name, album and track number to make sure we get the correct track.Declaration
Swift
func getMusicSongID(title: String, album: String, track: Int) -> IntParameters
titleThe title of the song
albumThe album of the song
trackThe track of the song
Return Value
An AppleScript ID
-
Set the sync values of a music song
Declaration
Swift
func setMusicSongValues(songID: Int, values: MusicMatchModel.Values)Parameters
songIDThe AppleScript ID of the song
valuesThe values
-
Set the rating of a music song
Declaration
Swift
func setMusicSongRating(songID: Int, rating: Int)Parameters
songIDThe AppleScript ID of the song
ratingThe rating
-
Set the playcount of a music song
Declaration
Swift
func setMusicSongPlaycount(songID: Int, playcount: Int)Parameters
songIDThe AppleScript ID of the song
playcountThe playcount
-
Set the play date of a music song
Declaration
Swift
func setMusicSongPlayDate(songID: Int, playDate: String)Parameters
songIDThe AppleScript ID of the song
playDateThe play date
-
Send a notification with AppleScript
Declaration
Swift
func sendNotification(title: String, message: String)Parameters
titleThe title of the notification
messageThe message of the notification
View on GitHub