I apologize in advance, but I usually wait at least one iteration before upgrading my operating system. That means at least 10.15.1 and perhaps 10.15.2. I rely too much on my computer to be one of the post-release beta-testers.
The big change in Catalina so far, as far as 42 Astounding Scripts• is concerned, is that the iTunes replacement in Catalina does not have a “Share iTunes Library XML with other applications” option. This is causing a lot of problems for DJs, who use iTunes/Music to manage their collections but use other applications for gigs. And if you use the itunesLists script from 42 Astounding Scripts• you’ll find that your own iTunes Music Library.xml file will no longer update either.
You can get around this problem by manually exporting an XML file from the Music app.
- Open the Music app.
- Under the File menu, choose Library and then Export Library.
- Name the file “iTunes Music Library.xml” and store it in the iTunes folder in your Music folder. You should know where it goes because there will already be one there.
- Save the file.
You’ll need to do this every time your library changes and you care about those changes; Music will not automatically update the XML file like iTunes did.
As I wrote in the book, these are all scripts I use regularly. So I’ll be looking at updating the script to remove its reliance on an XML data file. This will likely involve rewriting the script in swift; some of its more esoteric functionality will probably disappear. The main thing I use the script for is copying music playlists from the Mac to an SDHC card, and that’s what the new script will likely focus on.
I have to confess that removing XML support from the Music app was a completely unexpected change to me. XML is an extraordinarily useful data format, very well suited for exchanging hierarchical data—such as artists->albums->tracks—between applications. I partially blame Python’s developers. Python’s XML library has always been difficult to use. That’s why the itunesLists script requires installing the lxml library. Without that library, XML is much more convoluted in Python.
MacOS uses, or used, Python heavily for its own built-in management utilities; had Python’s built-in XML been easier to use, I suspect that those built-in utilities would use XML more heavily than they do. And that would mean that macOS applications would use XML more than they do.
- 42 Astoundingly Useful Scripts and Automations for the Macintosh•: Jerry Stratton at Amazon.com (paperback)
- If you have a Macintosh and you want to get your retro on, take a look at 42 Astoundingly Useful Scripts and Automations for the Macintosh. These modern scripts will help you work faster and more reliably, and inspire your own custom scripts for your own workflow.
- Update To Catalina? Here’s How To Manually Export Your Music.app As XML: Dan White
- “As it turns out, it’s really easy to manually export out an XML version of your iTunes library if you need to keep the connection.”
More Astounding Scripts
- 42 Astoundingly Useful Scripts and Automations for the Macintosh
- MacOS uses Perl, Python, AppleScript, and Automator and you can write scripts in all of these. Build a talking alarm. Roll dice. Preflight your social media comments. Play music and create ASCII art. Get your retro on and bring your Macintosh into the world of tomorrow with 42 Astoundingly Useful Scripts and Automations for the Macintosh!
- Using version control with AppleScripts
- AppleScripts aren’t stored as text, which makes it impossible to track changes in AppleScript files using version control software such as Mercurial or Git.
- Play music faster in the Music App
- If you enjoy Marvin and the Chipmunks, you’ll love this AppleScript.
- 42 Astounding Scripts is live!
- Ready to get your retro on? Type in programs for your Macintosh and make it play music, roll dice, and talk to you? Customize your services menu? 42 Astoundingly Useful Scripts and Automations for the Macintosh is the book for you!
- About Astounding Scripts
- Because I can!
More Astounding Scripts updates
- Random colors in your ASCII art
- One of the great things about writing your own scripts is that when you need new functionality, you can add it. I needed random colors in a single-character ASCII art image. It was easy to add to the asciiArt script. Here’s how.
- Avoiding lockFocus when drawing images in Swift on macOS
- Apple’s recommendation is to avoid lockFocus if you’re not creating images directly for the screen. Here are some examples from my own Swift scripts. You can use this to draw text into an image, and to resize images.
- 42 Astounding Scripts, Catalina edition
- I’ve updated 42 Astounding Scripts for Catalina, and added “one more thing”.
- Catalina vs. Mojave for Scripters
- More detail about the issues I ran into updating the scripts from 42 Astounding Scripts for Catalina.
- Big Sur and Astounding Scripts
- Big Sur does not appear to need any changes to any of the scripts in the book.
- Two more pages with the topic Astounding Scripts updates, and other related pages
More iTunes
- Catalina vs. Mojave for Scripters
- More detail about the issues I ran into updating the scripts from 42 Astounding Scripts for Catalina.
- A present for Palm
- Palm needs a little help understanding XML.
- Getting the selected playlist in iTunes
- It took a while to figure out how to get iTunes’s selected playlist as opposed to the current playlist in AppleScript.
- Cleaning iTunes track information
- Python and appscript make it easy to modify iTunes track information in batches—if you’re willing to get your hands dirty on the Mac OS X command line.
- Play this song backwards in iTunes
- Using AppleScript and Quicktime, you can play any song backwards. Find out what Fred Schneider was saying on “Detour Thru Your Mind”.
- Five more pages with the topic iTunes, and other related pages
More XML
- Parsing JSKit/Echo XML using PHP
- In the comments, dpusa wants to import JSKit comments into WordPress, which uses PHP. Here’s how to parse them using PHP.
- Parsing JSKit/Echo XML comments files
- While I’m not a big fan of remote comment systems for privacy reasons, I was willing to use JSKit as a temporary solution because they provide an easy XML dump of posted comments. This weekend, I finally moved my main blog to custom comments; here’s how I parsed JSKit’s XML file.
- Auto-closing HTML tags in comments
- One of the biggest problems on blogs is that comments often get stuck with unclosed italics, bold, or links. You can automatically close them by transforming the HTML snippet into an XML document.
- minidom self-closes empty SCRIPT tags
- Python’s minidom will self-close empty script tags—as it should. But it turns out that Firefox 3.6 and IE 8 don’t support empty script tags.
- A present for Palm
- Palm needs a little help understanding XML.
- Five more pages with the topic XML, and other related pages