用于刷新单个 iTunes 播客的 Applescript 代码

Posted

技术标签:

【中文标题】用于刷新单个 iTunes 播客的 Applescript 代码【英文标题】:Applescript code to refresh a single iTunes podcast 【发布时间】:2019-06-25 21:17:35 【问题描述】:

我更喜欢在我控制的时间刷新我的 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 中刷新 单个 podcast?

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

【问题讨论】:

这是我在 Google 搜索 applescript itunes updatePodcast 时发现的一个示例:gist.github.com/nandff/314081 它看起来应该可以工作,但我无法对其进行测试。我想您也可以将first trackupdatePodcast (first track of playlist "Podcasts" whose album is album_name) 更改为:every track ... 查看对我原帖的编辑。 【参考方案1】:

试试这样:

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

【讨论】:

叹气,我猜这是 iTunes 版本的问题……无论如何,谢谢!

以上是关于用于刷新单个 iTunes 播客的 Applescript 代码的主要内容,如果未能解决你的问题,请参考以下文章

Sqlite 查询:每个播客的最近五集

如何跟踪用户收听特定播客的时间

来传智播客的目的

来传智播客的目的以及未来的人生规划

来传智播客的感想

来传智播客的目的以及对未来人生的规划!