我试图从我的图书馆获取独特的iTunes艺术家和流派的列表。在某些操作中,AppleScript可能会很慢,在这种情况下,我无法在速度上做出妥协。有没有进一步的重构,我可以做我的代码?通过AppleScript获取独特的iTunes艺术家列表
tell application "iTunes"
-- Get all tracks
set all_tracks to shared tracks
-- Get all artists
set all_artists to {}
repeat with i from 1 to count items in all_tracks
set current_track to item i of all_tracks
set current_artist to genre of current_track
if current_artist is not equal to "" and current_artist is not in all_artists then
set end of all_artists to current_artist
end if
end repeat
log all_artists
end tell
我觉得应该有一个更简单的方式来获得从我只是不知道iTunes的艺术家或流派的列表...
你检查过DougScripts吗?那里有很多脚本快速运行。有一个专门用于你想要的东西,如果你愿意,可以将它导出到一个txt文件。我现在不记得它的名字,但它使我的74GB音乐的快速工作。 – Chilly