Spotify - 音量 - AppleScript API
Spotify - sound volume - AppleScript API
我已经尝试了很多很多场景来制作一个脚本来提高音量但没有成功。这里的例子:
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
或:
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
为了调试,我在不同的步骤后使用命令 "SAY sound volume",我发现该值停留在他第一次获得的相同值上。它 "reset" 的唯一方法是按 pause/play。每次我 pause/play "sound volume" 得到新值和修改工作一次,直到我再次 pause/play。
在此求助:https://forum.keyboardmaestro.com/
他们说我应该将此事报告给 Spotify。在 Spotify 上,我正在寻找我应该报告的地方,它说 none 开发人员到 post 在这里。所以我来了。
所以我的问题是:
我是谈论这个错误的合适人选?
和
有没有人有解决办法?
看起来你在其他地方问过这个问题并且可能找到了答案:这在某些版本的 Spotify 中被破坏了,但你所拥有的基本上是正确的。
我在下面对其进行了扩展,因为(至少在 v1.0.20.94.g8f8543b3 中)如果您将其设置为高于 100 的值,音量将回绕到 0。同样,如果您尝试将其回绕到 100将其设置为 0 以下。
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
我也需要相反的东西。很明显,但你去吧:)
tell application "Spotify"
set currentvol to get sound volume
-- volume wraps at 100 to 0
if currentvol < 10 then
set sound volume to 0
else
set sound volume to currentvol - 10
end if
end tell
end alfred_script
(我在制作a workflow for Alfred3)
我已经尝试了很多很多场景来制作一个脚本来提高音量但没有成功。这里的例子:
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
或:
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
为了调试,我在不同的步骤后使用命令 "SAY sound volume",我发现该值停留在他第一次获得的相同值上。它 "reset" 的唯一方法是按 pause/play。每次我 pause/play "sound volume" 得到新值和修改工作一次,直到我再次 pause/play。
在此求助:https://forum.keyboardmaestro.com/
他们说我应该将此事报告给 Spotify。在 Spotify 上,我正在寻找我应该报告的地方,它说 none 开发人员到 post 在这里。所以我来了。
所以我的问题是:
我是谈论这个错误的合适人选?
和
有没有人有解决办法?
看起来你在其他地方问过这个问题并且可能找到了答案:这在某些版本的 Spotify 中被破坏了,但你所拥有的基本上是正确的。
我在下面对其进行了扩展,因为(至少在 v1.0.20.94.g8f8543b3 中)如果您将其设置为高于 100 的值,音量将回绕到 0。同样,如果您尝试将其回绕到 100将其设置为 0 以下。
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
我也需要相反的东西。很明显,但你去吧:)
tell application "Spotify"
set currentvol to get sound volume
-- volume wraps at 100 to 0
if currentvol < 10 then
set sound volume to 0
else
set sound volume to currentvol - 10
end if
end tell
end alfred_script
(我在制作a workflow for Alfred3)