gpt4 book ai didi

Applescript 更改当前在 iTunes 中播放的歌曲的评级

转载 作者:行者123 更新时间:2023-12-05 00:04:02 29 4
gpt4 key购买 nike

我设置了一个applescript 来更改iTunes 中当前歌曲的评级,它在前几次工作但现在什么也不做。这是代码:

tell application "System Events"
if (name of processes) contains "iTunes" then
set iTunesRunning to true
else
set iTunesRunning to false
end if
end tell

if iTunesRunning then
tell application "iTunes"
repeat with theTrack in (get selection)
set the rating of theTrack to 100
end repeat
end tell
end if

有人看到那里有任何明显的问题吗?仅供引用,这是附加到全局热键,但即使在 Applescript 编辑器中打开它并点击“运行”也没有任何作用。

最佳答案

确认。我所要做的就是要求自己找到答案。

tell application "System Events"
if (name of processes) contains "iTunes" then
set iTunesRunning to true
else
set iTunesRunning to false
end if
end tell

if iTunesRunning then
tell application "iTunes"
set rating of current track to 100
end tell
end if

关于Applescript 更改当前在 iTunes 中播放的歌曲的评级,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6049280/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com