Batch-Change Media Kind Bug
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
try
set media kind of aTrack to audiobook
end try
end repeat
end tell
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.