如标题所示,我如何从iTunes中获取所有喜爱专辑的列表。
我有一个适用于播放列表的代码,但它并不像将playlist
更改为album
那么简单,因为相册名称(以及其喜爱的状态)存储为歌曲,播放列表是一个歌曲列表。
目前我有:
tell application "iTunes" to set PLs to the name of every playlist whose
loved is true as text
set PL to (choose from list PLs with title "Playlist") as text
此外,所有关注艺术家的名单都很棒
答案 0 :(得分:1)
你只能通过重复循环来获取所有喜爱的曲目并为专辑和艺术家创建两个列表
set lovedAlbums to {}
set lovedArtists to {}
tell application "iTunes"
set lovedTracks to every track whose loved is true
repeat with aTrack in lovedTracks
tell album of aTrack to if lovedAlbums does not contain it then set end of lovedAlbums to it
tell artist of aTrack to if lovedArtists does not contain it then set end of lovedArtists to it
end repeat
end tell
set TID to text item delimiters
set text item delimiters to return
set lovedAlbumText to lovedAlbums as text
set lovedArtistsText to lovedArtists as text
set text item delimiters to TID
display dialog lovedAlbumText & return & return & lovedArtistsText buttons {"Cancel", "OK"} default button "OK"