Trouble with Album art for New Music App Widget (AppleScript)

I've been using applescript widgets for my now playing setup as they are more predictable and stackable:

Just upgraded to Catalina, and I'm having trouble with converting the iTunes widget for the new Music app, specifically having trouble displaying the album art.

This code originally from the iTunes widget doesn't seem to work on Catalina:

if exists (every artwork) then
	tell artwork 1
		set srcBytes to raw data
		-- figure out the proper file extension
		if format is «class PNG » then
			set ext to ".png"
		else
			set ext to ".jpg"
		end if
	end tell
	set fileName to (("Users:" & (system attribute "USER") & ":Library:Application Support:BetterTouchTool:" as text) & "itunes_cover" & ext)
	-- write to file
	set outFile to open for access file fileName with write permission 
	-- truncate the file
	set eof outFile to 0					
	-- write the image bytes to the file 
	write srcBytes to outFile
	close access outFile
	--return "album art success"
end if

I've done some debugging and it seems to be this line that is the issue:

	set outFile to open for access file fileName with write permission 

Anyone know how to fix?

I've been fighting mine today as well (because like you, I also used applescript widgets for almost all of my stuff.) Finally upgraded to Catalina and am having problems with multiple things. I had similar issues as you, but when I check the scripting, it tanks on 'set scrBytes to raw data'.

Found another post on this forum somewhere while chasing something else down and the sorta-recommendation was to try the 'stock' now playing widget. So i went in and checked, and I did have one there. Added it and made it visible and voila. It works great. Artwork shows up and everything!!

IMG_3030|666x500

Now if I could only get the airpods widget to display my airpods pro battery percentages correctly. :stuck_out_tongue:

Yeah, I'm aware of the BTT native music widget, but it doesn't suit my use case as it appears for any playing music and not specifically music playing from the Music App...

This allows for stuff like this:


which allows me to specifically control what each app is doing from the touchbar all at once.

I like it. :slight_smile: Understood.

1 Like