I'm not too experienced with the Terminal so I bet that'll help more than I can. It appears II got mine working purely by chance after tearing several files and stuff apart
Running Mojave here. Getting an issue while trying to install Gem iStats for game mode widget that I don't have root permissions. Very strange since I have an admin account. Any recommendations?
this happens with spotify but the album cover and song name appears when i use spotify connect to play on another device, tried reinstalling spotify and the preset, no luck
Open "Script Editor" on your mac, and make a new document.
Put this script in and run, tell me what number shows up
if application "Spotify" is running then
tell application "Spotify"
try
if player state is playing then
set sName to (get name of current track)
set sArtist to (get artist of current track)
if (length of sName) > 25 then
set sName to text 1 thru 22 of sName & "..."
else
set sName to (get name of current track)
end if
if (length of sArtist) > 25 then
set sArtist to text 1 thru 22 of sArtist & "..."
else
set sArtist to (get artist of current track)
end if
if sArtist is not "" then
set nowPlaying to sName & " — " & sArtist
else
set nowPlaying to sName
end if
--fix JSON-Breaking Double Quotes
set aString to nowPlaying
set astid to AppleScript's text item delimiters
set AppleScript's text item delimiters to quote
set aString to text items of aString
set AppleScript's text item delimiters to "\\" & quote
set aString to aString as text
set AppleScript's text item delimiters to astid
-- Quotes have been vanquished
set nowPlaying to aString
set artworkURL to artwork url of current track
set fileName to ((((path to application support folder from user domain) as text) & "BetterTouchTool:" as text) & "spotify_cover.png")
set sNamePlist to ""
set sArtistPlist to ""
set plistfile_path to ((((path to application support folder from user domain) as text) & "BetterTouchTool:" as text) & "spotify_playing.plist")
set returnText to "{\"text\":\"" & nowPlaying & "\",\"font_color\": \"255,255,255,255\", \"icon_path\":\"" & (POSIX path of fileName as text) & "\" }"
-- read the plist file
tell application "System Events"
try
if file plistfile_path exists then
tell property list file plistfile_path
tell contents
set sNamePlist to value of property list item "sName"
set sArtistPlist to value of property list item "sArtist"
end tell
end tell
end if
if (sName is sNamePlist) and (sArtist is sArtistPlist) then
--return "Found it!"
tell application "BetterTouchTool" to set_string_variable "ShowNotPlayingMsg1" to "false"
--return returnText
return "1"
end if
on error
tell application "BetterTouchTool" to set_string_variable "ShowNotPlayingMsg1" to "true"
--return "{\"text\":\" Spotify \",\"font_color\": \"255,255,255,255\"}"
return "2"
end try
end tell
if (sName is not sNamePlist) or (sArtist is not sArtistPlist) then
tell application "System Events"
try
-- create an empty property list dictionary item
set the parent_dictionary to make new property list item with properties {kind:record}
-- create new property list file using the empty dictionary list item as contents
set this_plistfile to ¬
make new property list file with properties {contents:parent_dictionary, name:plistfile_path}
make new property list item at end of property list items of contents of this_plistfile ¬
with properties {kind:string, name:"sName", value:sName}
make new property list item at end of property list items of contents of this_plistfile ¬
with properties {kind:string, name:"sArtist", value:sArtist}
on error
tell application "BetterTouchTool" to set_string_variable "ShowNotPlayingMsg1" to "true"
--return "{\"text\":\" Spotify \",\"font_color\": \"255,255,255,255\"}"
return "3"
end try
end tell
do shell script "curl " & artworkURL & " -o ~/Library/Application\\ Support/BetterTouchTool/spotify_cover.png"
tell application "BetterTouchTool" to set_string_variable "ShowNotPlayingMsg1" to "false"
--return returnText
return "4"
end if
else
tell application "BetterTouchTool" to set_string_variable "ShowNotPlayingMsg1" to "false"
--return "{\"text\":\" Spotify \",\"font_color\": \"255,255,255,255\"}"
return "5"
end if
on error
tell application "BetterTouchTool" to set_string_variable "ShowNotPlayingMsg1" to "false"
--return "{\"text\":\" Spotify \",\"font_color\": \"255,255,255,255\"}"
return "6"
end try
end tell
else
tell application "BetterTouchTool" to set_string_variable "ShowNotPlayingMsg1" to "true"
return "7"
end if
After installing the latest BTT update I ran into the same issue as @platterfoot. I tried the script you posted and it returned "1". Also, now the "current song" is gone entirely on the Spotify app set.
Hi, im new here, im having trouble when enter to YouTube the stock Touch Bar appears and can't use de YouTube widget that you made, unless go yo the AquaTouch button then YouTube, but every time I change tabs, when go I back to the YouTube tab again the stock Touch Bar appears