【问题标题】:Applescript list of loved albumsApplescript 喜爱的专辑列表
【发布时间】:2016-03-15 10:02:36
【问题描述】:

如标题所示,我如何在 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

此外,所有关注的艺术家的列表也会很棒

【问题讨论】:

    标签: applescript itunes


    【解决方案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"
    

    【讨论】:

    • 谢谢,只需要前 9 行,完美运行
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-03-28
    • 2015-05-23
    • 2011-11-15
    • 2012-05-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多