A Twitter denizen inquired how to be able to tab between two or three button in a dialog instead of having to use the mouse to click the one in particular.
Go to System Preferences > Keyboard > Shortcuts. At the bottom you will see a setting for "Full Keyboard Access". Click the button next to "All controls". Afterwards, you'll notice that selected buttons will have a focus ring. You'll probably notice some other UI elements will have focus rings, too. Which is why I only toggle it on (Control-F7) for testing. It's a bit too distracting for regular use at my house.
I mention this as a tip because many of my scripts use two or three buttons and if you are mouse-averse and keyboard-loving then it should be a treat.
Mojave introduced some interesting contextual editing features to Quick Look. Quick Look was already handy for viewing disparate types of files in the Finder by pressing the Space Bar while a file was selected. Now, depending on the type file being viewed in Quick Look, various editing widgets will be made available.
I was very surprised when Apple first demo'd Quick Look in Mojave and saw that audio editing was a possibility. Albeit, it's just simple trimming—that is, audio can be removed from the beginning and/or ending of an audio file—but it might prove handy.
A few years ago I posted an AppleScript wrapper for the qlmanage command line tool, called Have a Quick Look. It allows you to select a track in iTunes and display a Quick Look panel of the selected track's file. A trifle, really.
But now that Quick Look has this new editing feature, Have a Quick Look could be a slightly handier tool. Here is a track from one of my "Live At Leeds" albums by The Who, which I have selected in iTunes and then run Have a Quick Look on. Pete Townshend famously talks a lot before each song. Now, I can trim that part out (sorry, Pete):
You can see the :40 seconds of Pete pontificating at the start of the track
Optimally, this sort of editing should be done with a Real Audio Editor. But if you're just fixin' Voice Memos (which can be added to iTunes by dragging from the Marzipan Voice Memos app) or something like that, I suppose this could be helpful.
A variation of this has been around since the first beta, but what the heck:
tell application "System Events"
tell appearance preferences
set dark mode to not dark mode
Save it in Script Editor named "Toggle DM" (or whatever) and select "Application" as the File Format, which makes it activate by clicking on it in the Finder. I recommend putting it in the Dock or Finder window toolbar for quick access.
Apple recently made a cool widget available for embedding Apple Music previews on websites. Such as:
The Apple Music Tools website allows you to search for an album and then generate an embed code that provides settings for various display options.
We've decided to use these links in the Show Notes for The Next Track podcast episodes; at the end of every episode, we pick an album we're listening to and the Apple Music previews are a nice convenience.
The thing is, since we always use the same format for the iframe that is generated, it is only necessary to change the URL used in the embed code. Thus, we don't have to visit the Tools website for each album. We can get the "Share Album" link in the iTunes app and just paste it into the iframe.
And this can be automated with AppleScript to a degree. Here's a script that takes the album URL copied to the clipboard (after manually clicking "Copy Link"), prepares it properly (the share URL has a different sub-domain string than the one used in the embed code) and then places the full iframe text back into the clipboard so it can be pasted into our Show Notes template:
set sourceURL to the clipboard
set snippet to text ((offset of "apple.com" in sourceURL) + 9) through -1 of sourceURL
set the clipboard to ("<iframe allow=\"autoplay *; encrypted-media *;\" frameborder=\"0\" height=\"300\" sandbox=\"allow-forms allow-popups allow-same-origin allow-scripts allow-top-navigation-by-user-activation\" src=\"https://embed.music.apple.com" & snippet & "?app=music&at=11l6om\" width=\"660\"></iframe>
") as text
tell application "Safari" to activate
It brings Safari to the front after creating the iframe text because we edit the template in the browser.
If you use this, you may want to make sure you like the height, width, and other settings. If you edit the script, be sure to escape any double-quotes.
Sometimes it's difficult to tell if a bug is really a bug or just a bizarre design decision. What I thought was a fixed bug might be the latter. The gist of this particular situation is that while you can select an individual Music track and change the Media Kind in its Show Info > Options panel to Music, Podcast, Audiobook or Voice Memo, you cannot select anything but Music on a batch selection. This post at Apple Discussions illustrates the issue with screenshots.
It is frequently desirable to change the Media Kind of Music tracks to Audiobook because these kinds of files are often imported as Music tracks. But unless you want to change each one individually there's only a complicated workaround that apparently requires deleting and re-adding.
I did not try this workaround. Instead I wrote this AppleScript that changes the Media Kind of the selected tracks to Audiobook:
tell application "iTunes"
repeat with aTrack in selection
set media kind of aTrack to audiobook
A Correspondent alerted me to the issue and he tested this script out on a few batches of tracks without a problem (thanks again, Stephen).
To use the script: Open it in Script Editor by clicking the little script icon above. Save it named whatever you like with the Format "Script" (.scpt) in your ~/Library/iTunes/Scripts/ folder so that it will be listed in the iTunes Script menu. As usual with little scripts like this its often expedient to add a keyboard shortcut.
It actually takes more words to explain what this script does than words used in the script itself.
You might be listening to a playlist when you hear a song that doesn't belong in that playlist—a Frank Zappa track ended up in a Frank Sinatra playlist, for example. You could: right-click on the iTunes LCD and click the "Remove From Playlist" item. If you haven't disabled it, you'll see a confirmation dialog asking if you realy want to remove the current track from the playlist.
That's three clicks so far. And then, after the track is removed from the playlist, iTunes stops. And to resume, you'll either hit space bar to play the next track (which will be selected) or spend some time looking for a track to play next.
That's a lot of business.
So here's a script that will delete the the currently playing track from the current playlist and start playing the next track* automatically:
tell application "iTunes"
if special kind of current playlist is not none then return
set deleteThis to current track
Open this in Script Editor by clicking the little little script icon above. Save it named whatever you like with the Format "Script" (.scpt) in your ~/Library/iTunes/Scripts/ folder so that it will be listed in the iTunes Script menu. Follow the instructions on this page to add a keyboard shortcut.
Oh yes. A keyboard shortcut.
The first line ensures you don't run this on a track playing from a media library playlist, because deleting a track from one of those deletes the track from the library. Then it stores a reference to the currently playing track, then plays the next track. Finally, the former current track is deleted from the playlist. The try block is used so that if the track can't be deleted for some reason the script will fail gracefully.
*The Next Track is a terrific podcast I co-host.
I've mentioned my "Name New Playlist From Selection" script in the past. It emulates iTunes' "Playlist From Selection" command with the added feature of asking for the playlist name before actually creating the playlist. This just seems to make sense to me rather than naming it afterwards. I've given it the same keyboard shortcut as the iTunes command (Shift-Command-N) so that the script is launched instead of the command being carried out.
Here is an updated version of that script which adds an option to provide a playlist description. The default text presented will be "Created 4/4/2018", or whatever the current date is.
As you probably know: when you first mount a new CD and have a look at it in iTunes, the track information you see, for the most part, is not from the CD. (Well, there is such a thing as CD Text but it is not widely used.) Instead, this information is typically retrieved over the internet from Gracenote, a company that maintains an information database of virtually every CD.
Ostensibly, the record labels provide Gracenote with the correct metadata for their products. But users can contribute "corrected" track data to Gracenote from many music apps, including iTunes. Crowd-sourcing this information famously has its, uhm, pitfalls.
Recently, a Correspondent told me of an issue with finding return and linefeed characters in the Name tags of some of his tracks, metadata which were undoubtedly retrieved from Gracenote. These control characters aren't supposed to be used in iTunes tags. In fact, entering a return character in most iTunes text fields is usually a signal to end editing. At best, iTunes does not accommodate line ending characters very well. The ID3 Tag spec may not permit them either, but I am not certain. Of course, I suppose it is possible that some other music app does allow return or linefeed characters in its track entries database.
So, evidently, perhaps someone was able to upload Name metadata to Gracenote formatted with line breaks, something like so:
Cycle for Children v2 XI Jerring Song ' The Sun Shines Into The Church' (allegro ironico) (Gyermekeknek Sz42)
(At first, I thought the problem was that a linefeed was somehow "attached" to the single quote character; but in the second instance the linefeed is followed by a space. So maybe this was just poor cursor placement or bad automation.)
Depending on the app and the UI element that is rendering this text, the linefeed characters may not actually "feed" a new line but instead will be replaced with a space character (on the screen, anyway). This leads me to think that perhaps the source machine was a WIndows box; there was a time when "Mac or PC" made a difference in this regard. I still see Windows XP-era text effluvia in some Comments tags, for example.
In any case, while it may seem that formatting Name text with control characters wouldn't be a problem, its the sort of thing that may "work fine...until it doesn't". My Correspondent found that several AppleScripts of mine that he was using weren't working to remove these errant control characters. (Who knows what kind of havoc may be unleashed when syncing these tracks to a device or iCloud?)
So, I created a simple script that removes any return or linefeed characters from the Name tags of a selection of tracks in iTunes.
The iCloud Download column cannot be removed from a playlist in Songs View for very long (it can't be removed at all from a playlist in Playlist View). You can hide it using View Options, but this will only be temporary and it won't be long before it pops back up again. Its default initial placement seems to be adjacent to the Name column.
Personally, I like having this column available since I sometimes want to know if a track I want to work on has a local file or one that resides in the cloud. But I have heard from Correspondents who would prefer this column to stay hidden when they hide it.
Well, the trick I use is to keep it visible...but not visible. If you're like me, you probably have the most important tag columns on the left side of a playlist in the browser window (while in Songs view). But I also keep non-essential/less-frequently-used columns far-off to the right so they are not visible when the playlist is horizontally scrolled full left in the browser window. So, click-and-drag the iCloud Download column all the way over to the right side of a playlist.
If you do this in the Music library (with Songs selected) then every playlist you create subsequently will be configured the same way when in Songs view. Existing playlists will need to be manually adjusted.
I'm often hopping around in iTunes among the "Library", "For You", "Browse", "Radio" and "Store" tabs and likewise apt to be in a specific media library, like Podcasts or Movies. As such, it can be a minor pain to get back to my local Music library.
Okay, it's only a couple of clicks. But it does elicit from me a small "arghh" burp from time to time.
So here's a very simple script to which you can assign a keyboard shortcut that will display the Music library in the Library tab:
Save this in your home/Library/iTunes/Scripts/ folder and name it "Go to Music Library.scpt". The script will appear in the iTunes Script menu. Then, open System Preferences and go to the Keyboard panel. Select "Shortcuts" and then "App Shortcuts" from the list on the left. Click the "+" button on the right side. In the drop down panel, select "iTunes" in the Application popup. Enter the name of the script, "Go to Music Library", in the Menu Title text field. Enter your shortcut combination in the Keyboard Shortcut text field (I use Control-Command-H, where the "H" stands for "home"). Click the "Add" button and then close out of System Preferences. Thus, whenever you want to get back to your Music library, just hit the shortcut.
I've done something similar for my Internet Radio Station playlist.