我正在尝试从iTunes ID(即:656479918)向播放列表添加歌曲,如果有帮助,我也会从iTunes搜索API中获取一些数据。 如何使用AppleScript将此曲目添加到iTunes中的现有播放列表?
{
wrapperType: 'track',
kind: 'song',
artistId: 1249595,
collectionId: 656479857,
trackId: 656479918,
artistName: 'The Rolling Stones',
collectionName: 'Let It Bleed',
trackName: 'Monkey Man',
collectionCensoredName: 'Let It Bleed',
trackCensoredName: 'Monkey Man',
artistViewUrl: 'https://itunes.apple.com/us/artist/the-rolling-stones/id1249595?uo=4',
collectionViewUrl: 'https://itunes.apple.com/us/album/monkey-man/id656479857?i=656479918&uo=4',
trackViewUrl: 'https://itunes.apple.com/us/album/monkey-man/id656479857?i=656479918&uo=4',
previewUrl: 'http://a749.phobos.apple.com/us/r30/Music6/v4/0d/f1/99/0df1995a-02d6-d67c-7d67-1817008e43d7/mzaf_5915143712191719844.plus.aac.p.m4a',
artworkUrl30: 'http://is4.mzstatic.com/image/thumb/Music2/v4/76/e2/45/76e245d4-37dc-3597-8f89-75d6bc384923/source/30x30bb.jpg',
artworkUrl60: 'http://is4.mzstatic.com/image/thumb/Music2/v4/76/e2/45/76e245d4-37dc-3597-8f89-75d6bc384923/source/60x60bb.jpg',
artworkUrl100: 'http://is4.mzstatic.com/image/thumb/Music2/v4/76/e2/45/76e245d4-37dc-3597-8f89-75d6bc384923/source/100x100bb.jpg',
collectionPrice: 9.99,
trackPrice: 1.29,
releaseDate: '2013-01-01T08:00:00Z',
collectionExplicitness: 'notExplicit',
trackExplicitness: 'notExplicit',
discCount: 1,
discNumber: 1,
trackCount: 9,
trackNumber: 8,
trackTimeMillis: 251825,
country: 'USA',
currency: 'USD',
primaryGenreName: 'Rock',
isStreamable: true
}
答案 0 :(得分:0)
如果你的曲目在变量TR(class = track)中,那么你可以添加和删除播放列表“myList”,如下所示:
-- move track to playlist:
Tell application "iTunes" to duplicate TR to playlist "myList"
-- remove track from playlist:
Tell application "iTunes" to delete TR of user playlist "myList"
请记住,iTunes是异步的:例如,删除命令可能不会立即执行,但会在一段时间后执行。