在 Mac 上,当按下“按下/播放”媒体键 ( F8) 并且没有应用程序拦截该键时,它会打开 iTunes 并开始播放。有没有办法让它打开另一个应用程序?就我而言,我希望它打开 Spotify。如果有可能让它在发布时开始播放(也许 AppleScript 是实现此目的的方法?)
小智 5
我知道这个问题很老,但其他答案并不能真正解决问题。
您所要做的就是安装Karabiner(以前称为KeyRemap4MacBook)。
然后你只需要添加想要的行为。
Preferences菜单。Misc & Uninstall选项卡Open private.xmlprivate.xml在您喜欢的文本编辑器中打开文件用这个定义替换空文件:
<?xml version="1.0"?>
<root>
<!-- Spotify Path -->
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_APP_Spotify</name>
<url type="file">/Applications/Spotify.app</url>
</vkopenurldef>
<!-- Set Spotify definition -->
<appdef>
<appname>SPOTIFY</appname>
<equal>com.spotify.client</equal>
</appdef>
<!-- Use 'Music Play' key to launch Spotify if not ever in the application -->
<!-- else, act as normal play/pause button in Spotify, Itunes -->
<item>
<name>Change Play key to launch Spotify</name>
<identifier>private.play_launch_spotify</identifier>
<not>SPOTIFY, ITUNES</not>
<autogen>
__KeyToKey__,
ConsumerKeyCode::MUSIC_PLAY,
KeyCode::VK_OPEN_URL_APP_Spotify,
</autogen>
</item>
</root>
Run Code Online (Sandbox Code Playgroud)返回Change Key选项卡并单击Reload XML按钮。
您现在只需启用添加在列表顶部的新项目:
您可能会发现这也很有用。如何防止 iTunes 在按下媒体键时启动
Spotify 应默认响应 F8。如何获得精美的key图标?