2011-10-04 157 views
2

我试图运行一个将在iTunes中播放歌曲的Applescript。问题是我需要这首歌来拥有一位特定的艺术家。每当我写一些使用“艺术家”的剧本时,我会得到一个错误,指出艺术家无法访问。AppleScript在iTunes中与特定艺术家一起播放歌曲?

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

此代码可用于播放曲目,但我也需要指定艺术家,以便不会意外播放具有相同名称的曲目。任何帮助是极大的赞赏。

感谢,

山姆

回答

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 
相关问题