Applescript代码可刷新单个iTunes播客

时间:2019-06-25 21:17:35

标签: applescript itunes

我更喜欢在自己控制的时间刷新iTunes播客,因此通常我右键单击要刷新的播客,然后选择“刷新播客”。但是有时候我错误地选择了另一个菜单项,那才是真正的PITA。所以我想有一个Applescript,只刷新一个播客。我计划将播客硬编码到脚本中-我几乎每天都要做一个,而其他我可以在需要的时候单击鼠标右键来完成。如果我搞砸了,那么它的PITA比主要的要少。

iTunes词典有updatePodcastupdateAllPodcasts-显然前者是我需要使用的(我不想每次都更新它们)。但是我不知道如何指定播客!该词典没有podcast类或类似的内容,item也没有提供明显的指导。

我尝试过:

tell application "iTunes"
    updatePodcast NameOfPodcast
end tell

NameOfPodcast替换为iTunes播客列表中的确切字符串(AFAIK)。 Applescript告诉我:

error "iTunes got an error: NameOfPodcast doesn’t understand the “updatePodcast” message." number -1708 from NameOfPodcast

有人知道如何让iTunes从applescript中刷新单个播客吗?

编辑: 感谢@ user3439894和@ wp78de,但引用轨道无效。 AS抱怨音轨无法理解updatePodcast消息。如果我尝试获取专辑列表(every album of playlist "Podcasts" whose name is album_name),则会被告知album是一个属性,而它需要一个类名。

1 个答案:

答案 0 :(得分:0)

像这样尝试:

tell application "iTunes"
    set allTracks to every track of playlist "Podcasts" whose album is "podcast_name"
    repeat with singleTrack in allTracks
        updatePodcast singleTrack
    end repeat
end tell

或尝试

tell application "iTunes"
    updatePodcast (first track of playlist "Podcasts" whose album is "XY Podcast")
end tell