Alfredと組み合わせて使用する Applescriptがあります。これは、開いているものに応じて、iTunes またはRdioで現在のトラックを再生または一時停止します。私のスクリプトでは、Rdio が優先されます。これは、私は常に iTunes を開いており、特定の目的で必要な場合にのみ Rdio を開くためです。
多くの場合、トラックが iTunes で再生されているときにグローバル ショートカットを押してこのスクリプトを実行すると、トラックを停止するのに最大 15 秒かかります。ここでスクリプトを共有し、明らかな問題があるかどうか、またはそれを処理するためのより簡単で効率的な方法があるかどうかを確認したいと思いました.
私が得ることができるどんな助けにも感謝します!
tell application "System Events"
if (name of processes) contains "iTunes" then
set iTunesRunning to true
else
set iTunesRunning to false
end if
if (name of processes) contains "Rdio" then
set RdioRunning to true
else
set RdioRunning to false
end if
end tell
if RdioRunning then
tell application "Rdio"
if player state is paused or player state is stopped then
play
else if player state is playing then
pause
end if
end tell
else if iTunesRunning then
tell application "iTunes"
if player state is paused or player state is stopped then
play
else if player state is playing then
pause
end if
end tell
end if