Archive for the ‘Missing Menu Commands’ Category

October 25 '11 - 8:14 pm
Name New Playlist From Selection

I use the “New Playlist from Selection” command a lot to create temporary playlists. Actually, I use the Shift-Command-N shortcut more often than clicking the command in the File menu. But I’m irritated at all the dancing I have to do to name the new “untitled playlist”. It takes my attention away from what I was intending to do with the tracks. So, I rigged the script below to the keyboard shortcut Shift-Command-N—it works, luckily; sometimes assigning a shortcut that iTunes is already using doesn’t override the original command. The script does exactly what “New Playlist from Selection” does except now I can enter the name for the playlist before it’s created.

Here’s the script:
(more…)

September 28 '11 - 8:59 am
Column Browser Go Home

I’ve found that iTunes’ Column Browser feature is one of the best ways to navigate the Music library. But I’m often annoyed that I can’t easily restore the browser window to a full view of tracks after digging down to a particular set of tracks. To do so requires a lot of scrolling up and clicking. Correspondent Josh Rafofsky emailed me complaining of the same frustration and his solution was pretty good: Command-B to Hide the Column Browser, fn-Left Arrow to got to the top of the browser, and the Command-B again to Show the Column Browser. But even this gets tiresome and he asked if there might be a one-step scripting solution.

You know there is.

I put together this script which uses a combination of standard AppleScripting and GUI Scripting to emulate Josh’s shortcuts solution:

tell application "iTunes" to activate
tell application "System Events"
	key code 11 using command down
	tell application "iTunes" to reveal track 1 of (get view of front window)
	key code 0 using {command down, shift down}
	key code 11 using command down
end tell


Save this as whatever you like—I call it “Column Browser Go Home”—save it to the ~/Library/iTunes/Scripts folder, and assign it a shortcut (make sure you have enabled GUI Scripting, too, as outlined in this article on using key codes). When launched after you’ve Column Browsed to a discrete set of tracks it will restore the entire list of tracks and jump to the top of the selected playlist. In my case this is usually the Music library playlist, but it will work with any playlist that’s being viewed with the Column Browser.

[UPDATE] And after all that, @tonyhazeldine tweets: “The same can be done by clicking on the column titles at the top of the column browser.” Yes, but each column has to be clicked.

September 10 '11 - 9:49 am
Key Code Searching

Here’s a snippet I’ve been using for awhile which I just got around to posting on the key codes page. I keep my iTunes Column Browser set with Artists and Albums listed On Left. Whenever I’m looking for a particular album I run this script to select the Music library and put focus on the Search box:

tell application "iTunes"
	activate
	-- select the Music library
	reveal (some playlist whose special kind is Music)
end tell
tell application "System Events"
	-- bring focus to Search box - Command-Option-F
	key code 3 using {command down, option down}
end tell


I’ve given it a keyboard shortcut of Command-Option-S.

More information on AppleScripting iTunes with key codes and keystrokes is here.

March 13 '11 - 4:10 pm
Missing Menu Script Updated

Search Results to New Playlist, a script in the Missing Menu Commands section, has been updated to fix a bug when trying to copy a “dead track” if one happened to turn up in the search results. Regrettably, “dead tracks”, those for which iTunes can find no corresponding file, cannot be copied between playlists and this would cause the script to error out. Thanks to Correspondent Nicole St. Laurent for the heads-up.

February 26 '11 - 11:49 am
Skip and Pretend We Played This Redux

A popular item on the Missing Menu Commands page is Skip and Pretend We Played This. If a song is playing that you don’t really want to hear, you’d launch this script to increase its play count by 1 (since it would not be increased until the track actually finished playing), set the last played date to the current date and time (ditto), and play the next track. I use it in a live-updating Smart Playlist that, among other criteria, uses the last played date to only list songs not played in the past few weeks. This keeps any track I don’t want to hear from re-appearing for another few weeks. Ideally launched via shortcut, and so on.

But ANYway.

Correspondent Dirk Scharff noted that “if used in the first 2-20 seconds of the song the skip counter is increased too and that’s somewhat undesirable as this wouldn’t happen if I played that song.” I don’t pay much attention to skips at my house, but he has a point. So Dirk submitted a mod to the script which I have incorporated below:

(more…)

August 11 '09 - 10:44 am
Re-Posting Stream Startup Script

A couple few days ago I posted a script here that would ping the Radio Paradise stream until its server accepted the connection, suppressing the error dialog that would appear when a connection was denied. Well, that was the wrong version of the script. Here is the correct version, and the one I fire up every morning. You must select a radio stream track first, then run the script:

tell application "iTunes"
	if selection is {} then return
	set strm to (item 1 of selection)
	if (get class of strm) is not URL track then return
	repeat
		try
			play strm
			exit repeat
		on error m number n
			delay 15
		end try
	end repeat
end tell


The earlier script used the open location command, errors from which could not be defeated with the try block.

April 9 '09 - 12:04 pm
Missing Menu and Spare Parts Sections

Some visitors may have noticed a few changes to the site’s formatting. The main challenge with a site like this is trying to make it easy to find something, but too many links were making every page more cluttered than it needed to be. So I got rid a lot of the links that cluttered the left column; in fact, I got rid of the left column altogether. Most navigation can be done via the menu-like links in the header of each page.

I have tidied up the Missing Menu Commands page and added a Spare Parts page that lists a few helpful iTunes AppleScript routines and handlers for script-makers. I’ll continue to add to this page.

Finally, I dislike the way Amazon MP3s sometimes download with ” (Album Version)” at the end of their titles. Here’s a simple script, Remove (Album Version), that will delete that text from the selected tracks.

December 30 '08 - 2:40 pm
Artificial Skip Counts/Skip Dates

Recently, Mac OS X Hints ran a hint about overcoming iTunes’ criteria for increasing a track’s skipped count and skipped date via AppleScript. See, iTunes will only increase these properties if the track is advanced to another track during the first 2 to 20 seconds of play, and the hint tried to work around this so the skip properties could be increased anytime during play. Nothing personal, but I thought the OP at Mac OS X Hints kind of went overboard. This script on the Missing Menu Commands page will get the job done without a lot of fuss.

Site contents © 2001 - 2012 Doug Adams and weblished by Doug Adams, dougscripts AT mac DOT com.
All rights reserved. Legal.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc.