October 29 2019 - 4:00 pm

macOS 10.15.1 and Music v1.0.1

I just updated the OS and the Music app. Happily, it appears the artwork issues are fixed and AppleScript can access the artwork data of a track (unless it's a file downloaded into the "Apple Music" folder). Additionally, playlist drags into and out of Folder playlists work as expected; it's just as tricky as it ever was in iTunes, but at least it's a sure thing.

There is still an AppleScript bug whereby delete playlist leaves a "ghost" playlist in the Sidebar until the next Music re-start. I have a few scripts in the pipe that rely on being able to delete playlists properly so this will need to be fixed before they can get posted.

Also, the reveal playlist command fails to scroll the selected playlist into view if it is not already in the Sidebar's view.

Otherwise, seems pretty solid.

October 29 2019 - 12:15 pm

Latest Batch of Catalina Updates

Busy busy busy! So much so that the email newsletter I've been aiming to release still ain't got out and I have yet to even look at my App Store apps. The latter will not run in Catalina. But here's a batch of scripts that do:

October 28 2019 - 3:57 pm

Yes, There is Still an Artwork Issue

In case you haven't noticed: If you have downloaded a file from the cloud or have had Music provide artwork, the image data does not get written to the track's file, even though you will see artwork for a track throughout Music.

Additionally, there's no way for an AppleScript to access the artworks of these kinds of tracks.

If the files of your tracks had image metadata before updating to Catalina, then you probably don't have any artwork problems with those.

My specific issue is that files on machine A that have custom artwork I applied to them and that sync via Cloud Music Library do not have the custom artwork when I download them to machine B. Instead, they have whatever artwork Apple has assigned for the album.

I had hoped that there might be an AppleScript trick to workaround this, but as I mentioned above, AppleScript wlll error when attempting access the artwork data or raw data properties of these tracks:

tell application "Music"

set theTrack to item 1 of selection

count artworks of theTrack

--> 1 , accurately detects 1 artwork

get raw data of artwork 1 of theTrack

--> error number -1728

--> error "Music got an error: Can’t get raw data."

end tell

You can test this yourself, either with the script or by trying to copy the small artwork image displayed in the top left corner of a track's Show Info window and pasting it somewhere. It won't.

[UPDATE 10.29.19: Hey! Apple fixed many of these issues in the macOS 10.15.1 and Music v1.0.1 updates.]

October 24 2019 - 6:16 pm

iTunes Library.xml v. ITLibrary

A couple of years ago, Apple added a new option to iTunes Preferences:

This, and the fact that the support doc for this feature referred to the "Legacy library XML", was Apple's way of telling developers that the XML was going to go away.

The iTunes Library.xml file is a condensed version of the iTunes Library database periodically exported as a property-list-like text file by iTunes itself, generally whenever a change occurred to the database: you played or tagged a track, created or deleted a playlist, and so on. It can easily be imported and parsed quickly by an application, even an AppleScript. You've probably used an AppleScript from this site that asked you to turn the "Share" option on, right?

A year or two before the "Share" option was added, Apple introduced the ITLibrary framework, which is an API that developers can use to get info about the iTunes library (and now the Music and TV apps) instead of having to use the iTunes Library.xml file.

So anyway, the XML has finally gone away, effectively, since it is no longer automatically exported.

I've been trying to incorporate the ITLibrary framework into my projects whenever I can, especially for apps that need to display lots of tracks or playlists (like Media Folder Files Not Added).

But ITLibrary was apparently last updated for macOS 10.13. And now that iTunes has been split out into the media apps, it's usefulness over the XML file has not been improved.

(And please. Don't let me hear anyone suggest some groovy way of exporting the XML automatically. Forget about the XML. Unless it's for backups or something.)

  1. ITLibrary does not know about Work and Movement tags.
  2. ITLibrary does not know the difference between playlists in the Music app and playlists in the TV app. You can ask for discrete music tracks or TV tracks or movie tracks, but not discrete playlists from either app.
  3. ITLibrary does not know what a subscription playlist is. It's an Apple Music playlist you have added to your library. ITLibrary sees it as a Regular playlist.
  4. Ditto Loved and Disliked for tracks
  5. Ditto Loved and Disliked for playlists
  6. ITLibrary does not distinguish among types of cloud tracks (uploaded, matched, duplicate, etc)
  7. ITLibrary does not provide a Track ID which is used to correlate the tracks in a playlist to their library entries and vice versa.

And I'm sure I've run into other minor impediments. Wait, bonus gripe: converting decimal persistent IDs to hexidecimal. (Strangely, the ITLibrary required you codesign your app in order to use it, but I'm not seeing this prohibition in Catalina. Am I missing something?)

It would be great if someone over there could give us a dusted up version of ITLibrary. Meanwhile, there's still AppleScript.

October 19 2019 - 10:17 am

Batch Release of Fixed Updates

As I announced yesterday, the bug has been squashed. Here is a list of the scripts that were affected and links to their latest versions:

October 17 2019 - 9:34 pm

The Invalid Parameter Issue Solved

The bug that some users were experiencing with Catalina scripts from this site has been discovered.

The code was not accounting for variation in system menus. Thus, the "invalid parameter" was an incorrect counting of menu items (the "itemArray").

My Mom isn't even going to care about that. What she and everyone else really wants to know is that I will update and re-post the affected scripts within a day.

October 14 2019 - 10:43 am

Catalina Stuff

I've said previously that the AppleScript scripting definitions for the Music and TV apps are pretty much lifted from iTunes. However, there are differences.

For example, a script that targets composer of a TV track will fail. Because TV doesn't use the Composer tag. Or the Album Artist tag. Or the artist property. Instead of artist, TV has a director property. And a Music track doesn't understand show, season number or episode ID; a TV track won't grok movement or work properties.

Stuff like that makes it difficult to write one script that can work in both Music and TV without doubling-up some of the code. Or adding some extra conditional tests. I'm not complaining; it is what it is, to be simply trite about it.

* * * * * *

When analyzing the pasteboard in a drag operation from the Music app, the dragging pasteboard types include “”, but one would expect there to be “” type in place of—if not in addition to—the “tv.metadata” type. ¯\_(ツ)_/¯

* * * * * *

There is definitely an Artwork Issue. Files that I have downloaded from the cloud do not contain image metadata, but the artwork is certainly downloaded into the Music database because I can see it throughout my library. I just don't see the artwork being transferred to the files at all. The files do not have "Get Info" artwork and the artwork does not appear in a Quick Look panel. However, artwork appears as expected for files that have always been local.

* * * * * *

Files downloaded from the cloud also do not contain purchaser metadata. Not sure what that's about.

* * * * * *

The previous two metadata issues may be related.

* * * * * *

I still don't know what's causing the Invalid parameter error people are seeing with launching scripts. As far as I can tell, the issue "goes away" after a short time.

Frankly, there's so much stuff going on when you first launch anything in Catalina (with permissions and warnings and threatening security dialogs and other whatnots) that it just may be a minor system glitch.

October 12 2019 - 2:20 pm

Some Artwork Scripts Updated

I got the first batch of some Catalina-ready artwork management scripts posted today. The four scripts are:

Save Album Art to Album Folder v6.0 will export the artwork of the selected tracks (or the tracks in a selected playlist) as an image file to the folder which contains each selected track's file--presumably each track's Album folder--or a single user-selected folder.


October 11 2019 - 7:40 am

Dupin v3.0 for macOS 10.15

I've bumped Dupin up to version 3.0. It is for macOS 10.15 and later only.

Dupin eliminates the drudgery associated with managing those irksome duplicated tracks in your Music library.

You won't be able to update to the new version of Dupin via Sparkle from the last version, v2.14.1, because that version can't run on macOS 10.15. So you'll have to get Dupin v3.0 right here on the website.

Dupin v3.0 is a free update for properly registered users and requires macOS 10.15 and the new Music app. A new registration code is US$15 and registrations older than five years can be upgraded for US$5. Download and try it free in Demo Mode. If you're staying away from Catalina for a while, Dupin v2.14.1 is still available to work with iTunes.

October 10 2019 - 9:34 am

List MIAs v5.0

I have combined the utility of Super Remove Dead Tracks and List MIAs into a single script applet and Super Remove Dead Tracks is the runner-up in this contest.

The newest version of List MIAs for the Music app will not only display information about the files no longer associated with tracks in the library, it can also delete those "dead" tracks, which is what Super Remove Dead Tracks did (and can still do if you're using iTunes).

For the purposes of illustration, I Trashed some files for this screenshot:

That column on the left displays where Music thought I last left each file; but those files don't exist anywhere because I've already emptied the Trash. Now, I can have List MIAs simply delete all or a selection of those tracks.

List MIAs is free to use in Demo Mode, during which several features will be disabled: Delete Dead Tracks from Music, Reveal Selected Track in Music, Toggle Scan at Launch and performing a scan more than once per launch are inhibited. A registration code to unlock these features is US$2.99.

More information and download is here.

Site contents © 2001 - 2019 (that's right: 2001) Doug Adams and weblished by Doug Adams. Contact support AT dougscripts DOT com. About.
All rights reserved. Privacy.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc. This site has no direct affiliation with Apple, Inc.
The one who says "it cannot be done" should not interrupt the one doing it.