It is often convenient and desirable to have your designated iTunes Media folder—the folder pointed to in the “Advanced” tab of iTunes’ Preferences—located on a large external drive or server. Those of you who do this know the advantages.
An issue that has been known to occur with this configuration is that if the volume or server containing the designated iTunes Media folder does not mount during the computer’s startup before iTunes launches, iTunes will presume that this folder is inaccessible and it will default to using the ~/Music/iTunes/iTunes Media/ folder instead. It does this because it needs a definitive place in which to save CD rips (which still happen at my house), converted files and Store purchases.
(More modern versions of iTunes are much better at reverting to the designated iTunes Media folder if its volume is mounted later. But for years this was always dicey and still can be.)
This swapping of designated iTunes Media folders can be problematic. It can render tracks in the iTunes library dead, duplicated, missing, orphaned. And so on.
My podcast partner, Kirk McElhearn, and I discuss this issue on an upcoming episode of The Next Track podcast concerning using a network-attached storage device (NAS) to store iTunes media. In conjunction with that episode, I wrote a script applet to be used as a “Login Item”, Launch at Login, that will attempt to mount the volume at startup, confirm it is actually mounted and only then launch iTunes.
Typically, AppleScript can use the mount volume command, which under some circumstances requires providing a username and password. I didn’t want to do that because 1) it is difficult for AppleScript to securely manage storing that data and 2) it is awkward having users edit the script to “hard-code” their username and password. But this script avoids having to do that—and not in any devious way—by attempting to open a folder on the volume pointed to by an alias to it in a specific local folder on the startup drive. In order to open this alias’d folder the operating system will be obliged to mount the volume/server it is on; the script will wait until that folder is accessible and then will launch iTunes. If, for some reason, the folder does not become accessible within a reasonable amount of time because the volume didn’t mount, the script will not launch iTunes and will display an alert saying so. At that point the user can decide what to do; presumably, mount the server and then launch iTunes manually.
The anxious part of me feels obliged to note that this script does not use any security (other than being signed with my Developer ID) so if you do not want a volume or server to be mounted in unattended startup situations then do not use it.
There are some simple yet specific instructions and caveats to heed before using the script at your house so be sure to read the documentation that accompanies the script in the download. More information about the Launch at Login applet and download is on this page.
Doug’s Check For Update v1.2 is now available. This applet/droplet will check if an AppleScript that has been downloaded from this site to your computer has a newer version available.
This latest version fixes a problem that was occurring on some systems whereby the droplet function was not recognizing dropped files. It could still be used as an applet by double-clicking, but the handy drag-and-drop feature was amiss; this is fixed.
The script, for macOS 10.8 and later only, is free and can be downloaded from this page.
While some applets and all apps from this site have a menu command to “Check for Update…”, many AppleScripts do not. To make it easier to check if a script you downloaded at one time or another has a newer version available, use Doug’s Check For Update. Just drop an AppleScript file on it (or launch it and use an Open Panel to navigate to a specific script) and it will check the website for the latest version of that script:
Sure, it’d be great if I could include a Sparkle-like mechanism to automatically check and install updates—as my apps do. But the code required to do so would just add too much overhead to a—very likely—simple AppleScript.
More information and download is here.
The first wave of Apple Music trials will be expiring soon and if you haven’t subscribed for real it means saying so long to any Apple Music added to your iTunes library.
But as Kirk pointed out a while back, there may be some residual files left over in the ~/Library/Caches/com.apple.iTunes/SubscriptionPlayCache/ folder, which is sort of like an “iTunes Media” folder for Apple Music. It stores the specially protected audio files that are downloaded when you play a track from Apple Music on your Mac, ostensibly so iTunes doesn’t have to re-download them if they are played again. They can’t be user-played and are only useful to Apple Music. (This cache folder doesn’t apply to Radio music. Or to Apple Music you’ve added to your library for offline use, which is stored in your official “ITunes Media” folder.)
I’m not sure if these files will disappear when the trial ends for you. iTunes doesn’t appear to remove them even now, so if you’ve used Apple Music a lot then this folder will be loaded with quite a number of full-sized audio files. I’m a sucker for some of those “For You” playlists and I’ve managed to get my own cache folder up to about 7GB.
Flush Apple Music Cache Files is a simple script that will show the number of files in the cache and the space they take up and, if you wish, delete them:
And if you’re subscribing to Apple Music and are tight on drive space, you can flush all you want anytime. Apple Music will re-download any music it requires again later.
Download the script from this page.
Trackographer will monitor iTunes and send tag and time-of-play information of each track that plays (including iTunes Radio and internet radio streams if they provide track info) to a text file.
Preferences can be set to include or not include various basic tags and to create a plain text file or a tab-delimited text file which can be imported into a spreadsheet.
More information and download is on this page.
Trackographer v2.0 is a stay-open applet that will monitor iTunes as tracks are playing and send tag information from each playing track (including radio streams if they provide track info) to a text file. Preferences can be set to include or not include various basic tags and to create a plain text file or a tab-delimited text file which can be imported into a spreadsheet. The text output looks something like this:
This latest version is a maintenance update that fixes some issues with text not rendering properly in modern OS’s.
Inspired by this recent Mac OS X Hint, I’ve posted Have a Quick Look. This script uses the UNIX qlmanage command to display a Quick Look window of the selected iTunes track(s), which can be audio, video, and, perhaps most usefully, PDF, whereby Preview.app is not necessary. Need I add that a keyboard shortcut makes this very handy.
It’s not the size of your “iTunes Media” files that best describes how big your media file collection is. Often, querying Correspondents will report that their iTunes Media folder is so many GBs (or so many days-worth). But if that total includes a lot of video then the number of files is smaller than the same-sized folder containing just 128kbps audio files (eg: my “Star Trek” with Extras at 6GB+ is a little smaller than my “Compilations” folder which contains over a thousand files). Very few of my scripts and apps directly work on the files in the iTunes Media folder anyway, so in many cases its size is irrelevant; scripts work with tracks in iTunes, so the number of tracks is more important than the size of their files. A better relative measurement for comparison purposes is the size of your “iTunes Music Library.xml” file (located in ~/Music/iTunes). It has an entry for each track in your library and all (well, most) playlists. Therefore, the more tracks and playlists you have the larger the XML file will be.
OK. I suppose I don’t actually hate it. But you might find it convenient to change the “done” chime that sounds whenever you import or convert files in iTunes. I Hate That iTunes Done Chime! v2.0 will let you select a new sound to replace “boodely-OOP!” — which is actually named “complete.aif”. You can choose from any of the default system sounds (ping, sosumi, submarine, and so on), no sound, or your own AIFF sound file.
This latest version is simply a maintenance release and is saved as universal binary.