Jon*_* M. 5 applescript spotify spotify-app spotify-desktop
我尝试了很多方案来制作一个脚本,该脚本将无法成功提高音量。这里的例子:
tell application "System Events"
set MyList to (name of every process)
end tell
if (MyList contains "Spotify") is true then
tell application "Spotify"
set volcheck to get sound volume
set volcheck to (volcheck + 10)
set sound volume to volcheck
end tell
end if
Run Code Online (Sandbox Code Playgroud)
要么 :
tell application "System Events"
set MyList to (name of every process)
end tell
if (MyList contains "Spotify") is true then
tell application "Spotify"
set sound volume to (sound volume + 10)
end tell
end if
Run Code Online (Sandbox Code Playgroud)
为了调试,我在不同的步骤之后使用了“ SAY音量”命令,我发现该值卡在他第一次获得的相同值上。它将“重置”它的唯一方法是按暂停/播放。每当我暂停/播放“音量”时,都会获得新值,并且修改工作一次,直到我再次暂停/播放。
在这里我寻求帮助:https : //forum.keyboardmaestro.com/
他们说我应该举报此事以便发现。在Spotify上,我一直在寻找应该报告的地方,并说没有开发人员可以在此处发布。所以我在这里。
所以我的问题是:
我是谈论此错误的正确地方吗?
和
有没有解决的人?
看起来您已经在其他地方问过这个问题,并且可能已经找到了答案:这在 Spotify 的某些版本中被破坏,但您所拥有的基本上是正确的。
我在下面对其进行了扩展,因为(至少在 v1.0.20.94.g8f8543b3 中)如果将其设置为高于 100 的值,则音量将环绕为 0。类似地,如果您尝试将其设置为低于 0,它将环绕为 100 。
tell application "Spotify"
set currentvol to get sound volume
-- volume wraps at 100 to 0
if currentvol > 90 then
set sound volume to 100
else
set sound volume to currentvol + 10
end if
end tell
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1620 次 |
| 最近记录: |