applescript - 用于刷新单个 iTunes 播客的 Applescript 代码
问题描述
我更喜欢在我控制的时间刷新我的 iTunes 播客,所以通常我右键单击要刷新的播客,然后选择刷新播客。但有时我会错误地选择另一个菜单项,那就是真正的 PITA。所以我想要一个只会刷新一个播客的applescript。我计划将播客硬编码到脚本中——我几乎每天都会做一个,其他的可以在我喜欢的时候通过右键单击来完成。如果我把它们搞砸了,它就不像是主要的 PITA。
iTunes 词典有updatePodcast
并且updateAllPodcasts
——显然前者是我需要使用的词典(我不想每次都更新它们)。但我不知道如何指定播客!字典没有podcast
类或类似的东西,也item
没有提供明显的指导。
我试过了:
tell application "iTunes"
updatePodcast NameOfPodcast
end tell
WhereNameOfPodcast
替换为 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
是一个属性,而它需要一个类名。
解决方案
试试这样:
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
推荐阅读
- css - 如何设置此选择的 z-index?
- batch-file - 打开文件夹中的所有 PDF
- javascript - Brython 问题:在 *.textContent 中填充的 HTML 布局标记未呈现
- c# - 如何打包和共享 Visual Studio 项目的最终版本
- arrays - 计算可能的“不相同”三角形的数量
- json - 如何在 Dart on Flutter 中填写包含全球所有电话前缀的列表?
- sql - 根据在存储过程中传递到临时表中的月数将日期拆分为月份和年份
- java - 使用域名和无端口连接到 java 套接字
- javascript - 我们可以仅使用 Intl.NumberFormat 显示阿拉伯货币符号吗?
- firebase - Firebase 可调用函数缓存标头?