我更喜欢在自己控制的时间刷新iTunes播客,因此通常我右键单击要刷新的播客,然后选择“刷新播客”。但是有时候我错误地选择了另一个菜单项,那才是真正的PITA。所以我想有一个Applescript,只刷新一个播客。我计划将播客硬编码到脚本中-我几乎每天都要做一个,而其他我可以在需要的时候单击鼠标右键来完成。如果我搞砸了,那么它的PITA比主要的要少。
iTunes词典有updatePodcast
和updateAllPodcasts
-显然前者是我需要使用的(我不想每次都更新它们)。但是我不知道如何指定播客!该词典没有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
是一个属性,而它需要一个类名。
答案 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