[软件] touch bar kkbox 歌曲资讯 btt

楼主: erikkk (erikkk)   2018-02-10 19:07:42
无聊写了一下 AppleScript
虽然 KKBOX 不支援 AppleScript
但是可以用 notification 硬搞出来
on isRunning(theAppName)
tell application "System Events" to (name of processes) contains
theAppName
end isRunning
if isRunning("KKBOX") then
set theContentNames to {}
tell application "System Events"
tell process "NotificationCenter"
repeat with theWindow in windows
set theContents to entire contents of theWindow
repeat with theContent in theContents
if class of theContent is static text then
set end of theContentNames to name of theContent
end if
end repeat
end repeat
end tell
end tell
if length of theContentNames >= 3 then
if item 2 of theContentNames is equal to missing value then
set theResult to (item 1 of theContentNames) & (item 3 of
theContentNames)
do shell script "echo \"" & theResult & "\" > ~/btt_kkbox"
end if
else
set theResult to do shell script "cat ~/btt_kkbox"
end if
return theResult
else
return "KKBOX"
end if
https://raw.githubusercontent.com/erikkkerikkk/btt/master/README.md
作者: fastyangmh (阿米斯)   2018-02-10 19:11:00
请问大大把kkbox改成itunes也可以用吗?
楼主: erikkk (erikkk)   2018-02-10 19:33:00
应该也是可以 我不确定 但itunes应该不用这么复杂的方法set track_name to the name of the current trackhttps://goo.gl/Dm17dv
作者: kennyf506 (Kenny)   2018-02-10 23:59:00
感谢大大
作者: callum1996 (是好吃的欧姆蛋)   2018-02-12 10:51:00
请问大大 这个要怎么用? 谢谢!https://imgur.com/a/Rs845 我出现这个讯息
楼主: erikkk (erikkk)   2018-02-22 20:07:00
touch /<path>/btt_kkbox

Links booklink

Contact Us: admin [ a t ] ucptt.com