dougscripts.com

iTunes 12

May 16 2016 - 2:25 pm

iTunes 12.4 Released

Apple released iTunes 12.4 today. It features a significant UI change as well as updates under the hood. And AppleScript additions!

I've just installed it and note these AppleScript changes right off the bat:

current track - now recognizes tracks being played from "For You" and "New" sections. The tracks will be URL class.

download - originally for podcast episodes, now includes the ability to download cloud tracks or playlists to your library.

select - tell iTunes which objects you want to select (as opposed to selection objects already selected manually). [UPDATE: This is incorrect; see here.]

downloader Apple ID and downloader name properties of track.

New subscription playlist (an Apple Music playlist), miniplayer window and video window classes.

I haven't tested any of these very thoroughly yet. In fact, only current track. And of course, there is likely more stuff to discover. More as it develops.

February 7 2016 - 12:44 pm

UPDATED: Album Rating Reset v2.0

Album Rating Reset will allow you to set the Album Rating and/or Album Loved for the albums of the selected tracks or the albums associated with the tracks in a selected playlist.

Album Rating Reset

I had pretty much given up on Album Ratings as just more Songs View clutter. I'd hidden the Album Rating column in Songs View. When there's no avoiding it in Album Views I prefer the computed Album Rating that averages the album's track ratings. But now that I use Apple Music fairly regularly, the Loved settings for tracks, albums and playlists in my library actually work pretty well with shaping Apple Music recommendations.

So I updated Album Rating Reset from a version last updated in 2007 to include Album Loved. The older version would only work on one track a time. But this version works on the selected tracks' albums or the albums associated with the tracks in a selected playlist. I don't think there is a way in iTunes to apply an Album Rating or Album Love to multiple albums at a time except while in Albums View.

Album Rating Reset

More information and download is on this page.

July 1 2015 - 11:07 am

UPDATED: Music Folder Files Not Added v4.5

Music Folder Files Not Added will list the file paths of the files in your designated "iTunes Media" folder which are not in iTunes' track library. Additionally, you can select a different parent folder and its contents will be compared to the iTunes library. Includes options to Add a selection of found files to iTunes, move them to the Trash, and export a text file listing the file paths.

This latest version accommodates some changes in iTunes 12.2 and provides preliminary support for OS X 10.11 (El Capitan) beta.

Music Folder Files Not Added is free to try for 10 days, $1.99 thereafter. This is a free update for registered users.

More information and download is on this page.

May 31 2015 - 10:42 am

Check For Library Corruption With xmllint

A Correspondent recently reported that a script which needed to read the current "iTunes Library.xml" file was failing. This XML file, as you may know, is exported periodically by iTunes and is pretty much an abridged output of the actual iTunes database. Even the XML file exported by iTunes' File > Library > Export Library... command was unable to be read. This suggested that there might be some corruption in the track entries, (I recently had a similar report and that database contained corruption that prevented the XML from being exported; the user reported that the XML had last been updated in 2012.)

iTunes can seem to behave normally even if there are tracks with corrupted track entry data or corrupted metadata in their files. So you might not even be aware of corruption until a third-party appliance elicits errors.

There is a command-line tool called xmllint that can find some corruption in the "iTunes Library.xml". You can run it from Terminal, or in a script like this:

set f to choose file

set rez to (do shell script "xmllint --valid --noout " & quoted form of POSIX path of (f as text))

This will error when it finds some badly encoded or improper UTF-8 text, which is often the culprit. Then it's just a matter of finding the troublesome tracks in iTunes and fixing the problems if possible. Usually this means just editing the tags in iTunes.

April 9 2015 - 1:49 pm

iTunes 12.1.2 Available

Apple has released iTunes 12.1.2 (strangely, we never saw v12.1.1). Improves photo syncing issues and fixes to the Get Info window. More as it develops.

[UPDATE 1] No fix to selection object in "Music Videos", still no fixes to CD Get Info and CD View Options shortcuts (probably a lost cause).

February 1 2015 - 11:40 am

Books, PDFs Playlists?

Working with a script to get all the names of the playlists in iTunes, I noticed that two playlist names popped up in the latest iTunes 12.1 that aren't actually visible in my Playlists: "Books" and "PDFs". Here's a script that illustrates:

tell application "iTunes"

get every playlist whose name = "Books"

--> {user playlist id 60870 of source id 80}

get every playlist whose name = "PDFs"

--> {user playlist id 60873 of source id 80}

end tell

While I almost certainly have had "PDFs" playlists in the past, this doesn't appear to be some artifact from a past library. These playlists aren't in the XML either, but they have persistent IDs and low index numbers. I tried using AppleScript's delete command to remove them but it didn't work, which leads me to believe these are hard-coded and are supposed to exist. Not sure what this is about (iTunes does use invisible playlists from time to time) but it may be inconvenient and inaccurate if you use a script that lists playlists.

UPDATE: Kirk speculates that ebooks may be returning to iTunes.

January 30 2015 - 6:23 pm

iTunes 12.1

Apple has released iTunes 12.1 with fixes to device syncing and a new widget for controlling iTunes in Notification Center.

Things fixed: selection object for selected tracks in Audiobooks library works, reference to Audiobooks library via "get view of front window" command works. Things not fixed: View Options for CD display, Command-I shortcut for CD "Get Info". More as it develops.

December 30 2014 - 11:10 am

Blanking the Genre Tag in iTunes 12

Kirk has found a bug in iTunes 12 whereby selecting a batch of tracks and deleting their Genre tag via the Get Info panel inserts 8 spaces instead of empty text into each track's Genre tag. This creates a Blank Genre that is actually displayed and selectable in Genre lists.

This AppleScript will correctly delete the Genre tag of each track in a selection:

tell application "iTunes"

set sel to selection

repeat with thisTrack in sel

tell thisTrack to set its genre to ""

end repeat

end tell

Also, any number of other scripts that can edit the Genre tag, like Multi-Item Edit, will get the job done.

November 14 2014 - 8:42 pm

Son of Latest Batch of Updates

Like last week, I hadn't gotten around to posting individual blurbs on all the updated stuff from this week (November 9-14). So, briefly:

Drop to Add and Give Info v3.0 - drop files onto this droplet and it will supply a Get Info-type interface to add basic tags to the tracks once they're added to iTunes. Better Yosemite support.

PDF Adder v5.0 - applet/droplet and PDF Service enable you to supply some basic tags to PDFs added to iTunes, the latter is a PDF Service workflow accessible from any app's Print Dialog. Yosemite support, minor tweaks.

Make PDF Booklet v3.0 - assists with creating lists of track data exported as a text-only PDF. Support for Yosemite.

This Tag That Tag v4.2 - copy, swap and append data between tags of selected tracks. Fixed a progress indicator that wouldn't indicate progress. I hate when that happens.

Delete Selected Files v2.1 - removes selected tracks and can move their files to the Trash or delete them immediately. Fixes a problem when canceling and progress would not cancel.

Drop to Add and Make Playlists v3.0- drop folders of media files onto this droplet and it will add the files to iTunes and create playlists for the tracks based on the names of the folders. Adds better support for Yosemite.

All HD and SD to Playlists v2.0 - creates two playlists containing, respectively, all the SD video tracks and all the HD video tracks in the library. Mostly just a maintenance update since last update in 2009.

Make An EQ Preset Script v3.0 - creates a new AppleScript applet using data from the selected EQ Preset. When that applet is launched it will re-create the EQ Preset in any iTunes (on a Mac). Handy way to archive EQ Presets. This is a major maintenance update, added better options in the applet for renaming.

Subscribe to the 30 Most Recent Scripts RSS or my Twitter feed @dougscripts to stay updated on script releases.

November 9 2014 - 2:51 pm

UPDATED: PDF Adder v5.0

PDF Adder is a collection of two AppleScripts that each assist with adding PDF files to iTunes as "digital booklet" PDF tracks. Each provides an interface for easily supplying Author (artist), Album, Category (genre), Year, Rating and Description tag data which is then applied to the newly-added PDF track entry in iTunes:

  • Add as PDF to iTunes is a PDF Service workflow that, when installed, will be available in the PDF pop-up menu of the Print Dialog. It allows you to save the current document as a PDF file (from any application that uses the Print Dialog) and add it to iTunes. I describe here how I use it with Safari Reader.
  • PDF Adder is an applet/droplet that will let you choose or drag-and-drop an existing PDF file and add it to iTunes. It can be installed in iTunes' Scripts folder for easy access from iTunes Script menu.

Anything you can print from the Print Dialog, you can make into a PDF. And any PDF can be added to iTunes.

The latest version of each script is compatible with Yosemite and has a few minor tweaks for better performance.

More information and download is here.

Site contents © 2001 - 2024 (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.