2016-03-15 75 views
1

作为标题,我可以如何从iTunes中获取所有喜爱的相册列表。Applescript爱列表列表

我有一个播放列表工作的代码,但因为专辑名称(以及其亲人状态)存储的歌曲,在这里作为一个播放列表的一部分,它并不像改变字playlistalbum一样简单歌曲列表。

目前我有:

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 

而且所有的列表,其后的艺术家将是巨大的

回答

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" 
+0

谢谢,只需要前9行,尽管完美 –