AppleScript在iTunes中与特定艺术家一起播放歌曲?

时间:2011-10-04 13:26:09

标签: applescript

我正在尝试运行一个将在iTunes中播放歌曲的Applescript。问题是我需要这首歌也有一个特定的艺术家。每当我写一些使用“艺术家”的剧本时,我都会收到错误,指出无法访问艺术家。

tell application "iTunes"
activate
play track "My Song"
end tell

此代码可用于播放曲目但我还需要指定艺术家,以便不会意外播放具有相同名称的曲目。非常感谢任何帮助。

谢谢,

萨姆

1 个答案:

答案 0 :(得分:2)

根据需要进行调整。

tell application "iTunes"
    set mySongs to every track of library playlist 1 whose artist is "Styx" and name is "boat on the river"
    repeat with aSong in mySongs
        play aSong
    end repeat
end tell
相关问题