dougscripts.com

October 8 2019 - 12:54 pm

Error at Launch

Some Correspondents have reported a problem when launching scripts for Catalina. The script doesn't launch and shows this error (screenshot from a Correspondent):

This was an issue that was reported several times during the beta period. I have been unable to replicate the problem myself on any Catalina installation. However, several users who reported it later found that—again, for unknown reasons—the issue eventually corrected itself.

It is baffling. The issue appears to occur during launch when the menu bar for the script is being populated. I'm keeping my eye on it, but, unfortunately, all I can recommend at this point is to check the script again after a few computer restarts.

October 3 2019 - 12:47 pm

Importing an iTunes Library.itl into Music

When you update to macOS 10.15 and the new Music app, your current iTunes library will be imported just as if you were simply updating to a new version of iTunes. You can also open an iTunes Library.itl file as if it were a "multiple library" by press-and-holding Option as you launch Music to get the "Choose iTunes Music Library" option.

I first saw this at the Apple Developer Forums. I tried it and it worked great. I haven't been using my main library while Catalina is still in beta because, well, it's my main library and Catalina is still in beta. But this was an easy way to have it available as on-demand optional library.

I copied the entire contents of ~/Music/iTunes/ to a new folder, except for my audio files which are stored elsewhere on an external drive; quit Music and restarted while holding the Option key. The dialog pops up asking you to "Choose Music Library" and I chose the "iTunes Library.itl" file from the folder I just copied the stuff to. Music then asks you to name and save the library. In a few minutes, the library was imported. The old "iTunes Library.itl" I selected was copied as a new new-style "Music Library.musiclibrary" and everything looked as I expected when the import was finished.

September 26 2019 - 2:07 pm

Ready for the Music App?

As of this date, it'll likely be a couple of weeks before Apple releases macOS 10.15 and the new Music app. The Music app is, essentially, iTunes stripped down to just its "music" components. You shouldn't have any troubles with it. Unless you bring your troubles with you.

If your iTunes library is a mess now, then your Music library will be a mess later.

Why not begin your Music experience with a sweet and tidy music library. This would be a good time to do some of that iTunes house-keeping you've been putting off: cleaning up tags, fixing artwork, paring dead tracks and non-essential playlists, minding the duplicates, backing stuff up and so on.

I keep a list of scripts recommended by task for just such occasions. You've probably still got a couple of weeks.

If you're on the macOS 10.15 beta, be sure to try out some of the Music-and-TV-ready scripts I've already posted.

September 18 2019 - 9:10 am

MacVoices

I was recently a guest on the MacVoices podcast, hosted by all around Good Dude, Chuck Joiner. Had a great time talking about our post-iTunes future.

September 9 2019 - 5:22 pm

Some App Updates for Catalina

I've just posted updates to two of my apps, Join Together v8.0 and M3Unify v2.0.

Join Together can create a single audio file from the two or more audio tracks you drag to it, from Music, iTunes or the Finder.

This latest version is for macOS 10.12 and later (including macOS 10.15).

M3Unify is a file utility that helps you manage copying audio files to a folder, drive, thumb or SD drive, ostensibly for use with portable and car audio devices.

This latest version is for macOS 10.14 and later only. And it, too, supports iTunes 12 and Music in macOS 10.15.

July 4 2019 - 8:01 am

UPDATED: CD Text to CD Info v5.0

It may be somewhat ironically serendipitous (or serendipitously ironic) that CD Text to CD Info v5.0 happens to be the first script I've posted specifically for the new Music app. Afterall, ripping audio from a CD seems quaint in the current age of streaming. But facetious jibes like "What's a CD? LOL!" aside, there are still plenty of CDs in the world that haven't been ripped yet and plenty of people who want to do the ripping. Thankfully, Apple has preserved this ability in the Music app.

CD Text to CD Info v5.0 will examine the selected CD mounted in Music for CD-Text and apply the album and track information to the CDs tracks. In this screenshot of the script's main window, all of the information (except disc number/count and year, which I entered manually) is from the CD's CD Text:

This is from a CD that I burned years ago in iTunes, which allowed me to include CD Text. Not all CDs contain CD Text, but many do. It would have solved a lot of metadata confusion if the music industry had insisted that CD Text be a mandatory Red Book standard from Day 1, but That's The Way It Went.

As I mentioned at the top, CD Text to CD Info v5.0 will only run on macOS 10.15 Catalina with the Music app, which are both currently in beta (the version that works with iTunes is still available here).

July 1 2019 - 9:01 pm

Doug's Check For All Updates v1.0

In case it isn't crystal clear: scripts written for iTunes will not work on macOS 10.15 and later. Since the iTunes application isn't available on the new OS, scripts that target it will fail. So, almost every script on the site will need to be re-written to work with the macOS Music and/or Apple TV apps that replace iTunes in macOS 10.15.

Oh, I'm keeping busy, all right. I would like to be posting updates for use with the Catalina betas. But there are currently some issues in the betas that have precluded me posting any Catalina-compatible scripts yet. I have no doubt that Apple will fix these minor glitches well before Catalina's offical release; I just don't know how soon. And even then, there will be a gradual rolling-out of script updates through the summer and fall.

To help users keep track of what scripts for which operating system have been updated and when, I've posted Doug's Check For All Updates. It's an applet that will survey your computer for all the scripts you have installed from dougscripts.com and generate a report listing which have been updated. This is unlike the "Doug's Check For Update" script, which can only check one script at a time.

Doug's Check For All Updates will work right now on any version of macOS 10.10 and later, including the macOS 10.15 betas.

May I suggest that it may be helpful to get some work done on your iTunes library with the latest tools now, before you update to Catalina and the new media apps. Your favorite script(s) may not be Catalina-ready by then.


A security aside: This is the first download I am posting that has been notarized by Apple, a requirement for third-party software if it is to be distributed outside the Mac App Store. As such, it is also the first download to be packaged as a .dmg (disk image file) without the .zip wrapper. The code-signing and notarization process in my workflow make it easier to process a disk image without the additional ZIP compression. All future new and updated scripts will be likewise packaged as DMGs.

June 26 2019 - 8:20 am

Targeting Two Media Apps

If you've got scripts you've written for iTunes, one of the first things you'll realise in Catalina is that instead of having one media app you have two. Sure, this seems self evident. Until you try converting your iTunes scripts to Music and/or Apple TV scripts.

Let's say you have a script that gets the name of the selected playlist. No matter what kind of playlist you selected in iTunes, this script reliably returned its name. Thus, it would work with a playlist containing strictly music tracks or one with only video tracks. But that was in iTunes. Now, music tracks are in Music and video tracks are in Apple TV.

You could write two scripts, one for Music and one for Apple TV. Or you could write a script that includes routines that can target both, doubling the size of your script.

Or you could use a simple trick to target one or the other app depending on where the script is installed. I always recommend putting your scripts in the app's "Scripts" folder. It's just a matter of getting the "path to me" which will return the file path of the script.

Then, you haul out the good ol' "using terms from". Throw it all together like this to make a script swing:

set myPath to (path to me) as text

set mediaAppName to "Music"

if (myPath contains ":Apple TV:") then

set mediaAppName to "TV"

end if

using terms from application "Music"

tell application mediaAppName

-- do your things in the app

set playlistName to (get name of view of front browser window)

end tell

end using terms from

Using the script's file path location—which will be something like Macintosh SSD:Users:username:Library:Music:Scripts:Name of Script.scpt or Macintosh SSD:Users:username:Library:Apple TV:Scripts:Name of Script.scpt—we can determine which app to target. This name is saved to the mediaAppName variable. (This trick will also work if you store scripts in the local Library folder or in the Library/Scripts/Applications/Music/ or Library/Scripts/Applications/Apple TV/ folders since they all contain the app name in the file path.)

Next, a using terms from block is hardcoded to target "Music", followed by the tell block for mediaAppName. This allows the script to compile while you're working on it in Script Editor. Since both the Music and Apple TV scripting goodness are virtually identical, you can indeed "use terms from" Music to automate either app.

Now instead of making two scripts, you can put a copy of one script in both Scripts folders. It doesn't work with aliases since the location of the Original file will be used.

You will need to wrap any tell statement targeting a particular app in the using terms from block. Also, you may want to assign the mediaAppName as a property or global in order to access it throughout the scope of more elaborate scripts.

UPDATED, July 31, 2019. Changed target "Apple TV" to just "TV", which is how the app is targeted in the latest macOS 10.15 betas. Note that the name required for TV app's "Scripts" folder's container is still "Apple TV".

June 25 2019 - 10:14 am

Catalina Public Beta

Yesterday, Apple released the first beta of macOS 10.15 Catalina to users in the Apple Beta Software Program. If you're in the program and have installed the beta, well, surprise! Scripts and apps written for iTunes will not work on it. That's because there is no version of iTunes in the beta for scripts and apps to work with.

As you are no doubt aware, Apple has replaced iTunes with the Music, Apple TV, Podcasts and Books apps. Between now and the official release of Catalina in the fall, I will be updating very many scripts to work with the Music and Apple TV apps—Podcasts and Books do not have AppleScript support.

Providentially, scripting the Music and Apple TV apps is very much like scripting for iTunes. Their scripting definitions are virtually identical. In many cases, for very simple scripts, updating will merely require changing the target from "iTunes" or "com.apple.iTunes" to "Music"/"com.apple.Music" or "Apple TV"/"com.apple.TV". More elaborate scripts may require additional modifications and security accommodations.

Thus, there will essentially be two sets of scripts on this site: those written for iTunes that can only run under macOS 10.14 and earlier and those for the newer media apps that can only run under macOS 10.15 and later.

I hope to have a first batch of Catalina-compatible scripts posted in about a week.

June 22 2019 - 4:33 pm

About Catalina's New Media Apps

Apple has posted an article, About the upcoming changes with iTunes on Mac, which describes the new media apps coming in macOS 10.15 Catalina.

Site contents © 2001 - 2025 (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 be interrupting the one who is doing it.