touch bar kkbox 歌曲資訊 btt - MAC

Kelly avatar
By Kelly
at 2018-02-10T19:07

Table of Contents

無聊寫了一下 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

--
Tags: MAC

All Comments

Kristin avatar
By Kristin
at 2018-02-12T23:58
請問大大把kkbox改成itunes也可以用嗎?
Carolina Franco avatar
By Carolina Franco
at 2018-02-14T13:22
應該也是可以 我不確定 但itunes應該不用這麼複雜的方法
Dorothy avatar
By Dorothy
at 2018-02-19T03:40
set track_name to the name of the current track
Barb Cronin avatar
By Barb Cronin
at 2018-02-20T13:01
https://goo.gl/Dm17dv
Andy avatar
By Andy
at 2018-02-25T07:33
感謝大大
Elvira avatar
By Elvira
at 2018-02-27T16:43
請問大大 這個要怎麼用? 謝謝!
William avatar
By William
at 2018-02-28T05:34
https://imgur.com/a/Rs845 我出現這個訊息
Irma avatar
By Irma
at 2018-02-28T10:22
touch /<path>/btt_kkbox

提醒事項通知一直標示有一個未讀通知

Lauren avatar
By Lauren
at 2018-02-10T12:16
最近不知道macOS怎麼了 明明已經把提醒事項都點選已完成 而且都清空了 App上面就是還是會顯示一個未讀通知 如圖:https://imgur.com/Kc8O9M7 有嘗試過icloud帳號登出再登入一次還是一樣=..= 好煩啊~~~請問有鄉民知道怎麼解嗎? 型號:MacBook Pro 1 ...

macbook pro 2015 / 2017 選擇

Barb Cronin avatar
By Barb Cronin
at 2018-02-10T11:39
大家好,最近因應工作上的需求需要再添購一台筆電 目前是在整修品中挑選 mbpr 15吋 2015 54K/ 2017 66K (i7/16G/256G) (本身私人用的筆電是 mbpr 2015 13吋) 目前考慮的點如下: 1. 我需要兩台 macbook 嗎? 2. 2017 的 I/O 穩定度及麻 ...

parallel 開bootcamp無法進入桌面

Dora avatar
By Dora
at 2018-02-10T10:31
餓死抬頭 直接開機按option可以進去win10 但OSX下開paralle 13開啟bootcamp進去就是這樣 https://i.imgur.com/XwayakO.jpg 可以開但進不了桌面 修復重啟按過再進去還是一樣 有解嗎? OSX win10 parallel 13 都是正版最新 - ...

使用type-c hub 同時外接htmi&vga的問題

Annie avatar
By Annie
at 2018-02-10T09:59
2017 no tb版 mbp 小弟想要同時外接兩個電腦螢幕 但是其中一個是hdmi 其中一個只有vga 網路上查了一些type c hub 同時有hdmiandamp;vga的不多 查到其中一個品牌上面寫說 hdmiandamp;vga不能同時用 想問一下 想要真正的實現外接兩個電腦螢幕分別 ...

MacBookAir2015整修vs 2017新品

Queena avatar
By Queena
at 2018-02-10T01:48
各位大大 打擾了 剛剛不小心手滑下訂MBA 13”整修品26000很便宜 結帳完才發現他是2015版本 但查了一下2017可以找到28900左右 兩台差距看了一下只有1.8G跟1.6G cpu的差異(是這樣沒錯吧? 在他還沒送來或是14天內還可以考慮 想請教一下 有需要因為這樣買2017版 ...