如何告诉 iTunes 显示下载“播放列表”使用 AppleScript(在 Mac OS X 上)?

发布于 2024-12-10 20:54:19 字数 690 浏览 0 评论 0原文

我经常在 iTunes 中选择某些播放列表,因此我创建了 AppleScript 来显示它们,然后使用 FastScript

这是一个用于显示我的“新播客”播放列表的 AppleScript:

tell application "iTunes"
    set view of (browser window 1) to user playlist "New Podcasts"
end tell

这是一个用于显示“音乐”的 AppleScript:

tell application "iTunes"
    set view of (browser window 1) to user playlist 1
end tell

我希望能够转到“下载”(正在下载新播客时),但我不知道如何从 AppleScript 执行此操作。我尝试使用各种数字而不是 1 将(浏览器窗口 1)的视图设置为用户播放列表 1,并将(浏览器窗口 1)的视图设置为用户播放列表“下载”代码>,但这些都不起作用。我在 iTunes AppleScript 词典中没有看到任何下载的迹象。

是否可以将 AppleScript 的视图设置为“下载”?如何?

I select certain playlists in iTunes so frequently that I've created AppleScripts to display them, and then bound them to keyboard shortcuts with FastScripts.

Here's an AppleScript for displaying my "New Podcasts" playlist:

tell application "iTunes"
    set view of (browser window 1) to user playlist "New Podcasts"
end tell

And here's an AppleScript for displaying "Music":

tell application "iTunes"
    set view of (browser window 1) to user playlist 1
end tell

I'd like to be able to go to "Downloads" (while new podcasts are downloading), but I can't figure out how to do it from an AppleScript. I've tried set view of (browser window 1) to user playlist 1 with various numbers instead of 1, and set view of (browser window 1) to user playlist "Downloads", but none of these work. I don't see any sign of Downloads in the iTunes AppleScript Dictionary.

Is it possible to set the view to "Downloads" from AppleScript? How?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谜兔 2024-12-17 20:54:19
tell application "System Events" to tell process "iTunes"
    tell outline 1 of scroll area 2 of window "iTunes"
        set statictexts to value of static text of rows
        repeat with i from 1 to number of statictexts
            if ((item i of statictexts) as text) starts with "Downloads" then
                set value of attribute "AXSelected" of row i to true
                return
            end if
        end repeat
    end tell
end tell
tell application "System Events" to tell process "iTunes"
    tell outline 1 of scroll area 2 of window "iTunes"
        set statictexts to value of static text of rows
        repeat with i from 1 to number of statictexts
            if ((item i of statictexts) as text) starts with "Downloads" then
                set value of attribute "AXSelected" of row i to true
                return
            end if
        end repeat
    end tell
end tell
久伴你 2024-12-17 20:54:19

没有简单的方法可以做到这一点。下载“播放列表”未被识别为对象。

如您所见,我尝试使用两种方法访问下载“播放列表”,但都给出了相同的错误。
在此处输入图像描述
在此处输入图像描述

还应该注意的是,如果您尝试选择以下任何一项,您将收到相同的错误"播放列表”:应用程序、iTunes Store、铃声、Ping。

查看这篇文章以获取替代解决方案:这里

There is no easy way of doing this. The Downloads "playlist" is not recognized as an object.

As you can see I've tried accessing the download "playlist" using two methods and both give me the same error.
enter image description here
enter image description here

It should also be noted that you will get the same error if you try to select any of the following "playlists" : Apps, iTunes Store, Ringtones, Ping.

Check out this post for an alternative solution : here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文