爱的相册的Applescript列表

爱的相册的Applescript列表,applescript,itunes,Applescript,Itunes,如标题所示,我怎样才能在applescript中从iTunes中获得所有喜爱的专辑列表 我有一个用于播放列表的代码,但它不像将单词playlist更改为album那么简单,因为专辑名称(及其喜爱的状态)存储为歌曲的一部分,其中播放列表是歌曲列表 目前我有: tell application "iTunes" to set PLs to the name of every playlist whose loved is true as text set PL to

如标题所示,我怎样才能在applescript中从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

此外,列出所有受欢迎的艺人也很好

你只能通过重复循环来获得所有喜爱的曲目,并为专辑和艺人创建两个列表

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"

谢谢,不过只需要前9行,效果很好