Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

iTunes 11: Keyboard shortcut to clear currently playing track Apps
Even though iTunes is my bailiwick over at Macworld, I've found the new Up Next feature to be quite confusing. It's taken me a while to suss out all its details and I've figured it out, but I find it quite confusing.

In updating my Take Control of iTunes: The FAQ ebook, my editor, Michael Cohen, noted a useful keyboard shortcut for working with Up Next. If you press Command-. (that's a period), this stops playback and clears the currently playing track from the iTunes LCD. I haven't yet found a way to clear the Up Next queue from the keyboard, however. If anyone's spotted a shortcut for that, feel free to post it in the comments or submit it as a hint. (As a reminder, you can display the Up Next queue by pressing Command-Option-U.)
  Post a comment  •  Comments (4)  
  • Currently 2.33 / 5
  You rated: 2 / 5 (6 votes cast)
[6,776 views] Email Article To a Friend View Printable Version
iTunes 11: Empty playlists and syncing to iOS devices Apps
If you choose to sync music by selecting specific playlists, you select your iOS device, then click the Music tab to check the playlists you want. I do this for my iPhone and iPod touch. I have found, however, that with iTunes 11, any playlist that is empty gets unchecked.

Here's why this is a problem for me. I have a few playlists that I use for listening to new music or podcasts. I manually place tracks in these playlists, when I have something to put in them. However, there are times when I sync my iOS devices that they are empty. In the past, this didn't matter; the next time I added something to the playlists, they would sync. But in iTunes 11, they become unchecked in the Music tab, and I have to manually go back and sync them again.

My solution is to add a very short silent track to the beginning of each of these playlists.Some time ago, I made these silent tracks to be able to use them as pauses in playlists, and posted them on my blog. The shortest one is .1 second, which I created for this hint. Just put the silent track anywhere in the playlist, but remember not to delete it, so the playlist never becomes empty.
  Post a comment  •  Comments (8)  
  • Currently 2.57 / 5
  You rated: 1 / 5 (7 votes cast)
[5,963 views] Email Article To a Friend View Printable Version
Change Mission Control Animation Speed (Mountain Lion) Apps
It's possible to change the time it takes for Mission Control to complete its animation. I'm all for decreasing animation times in Mountain Lion, so this is a handy tweak if you're interested in a similar thing.

In Terminal, type the following:
defaults write expose-animation-duration -float 0.1  ; killall Dock 
where 0.1 is the time; you can set it to any number you want; try several different numbers to see how this changes the animation. Press Return, and Mission Control's animation time is changed.

To revert it back to the default, enter the following in Terminal, then press Return:
defaults delete expose-animation-duration ; killall Dock 
[kirkmc adds: This is one of those hints that is, in part, "because we can," but I do understand the desire to make certain animations a bit snappier.]
  Post a comment  •  Comments (6)  
  • Currently 2.86 / 5
  You rated: 1 / 5 (7 votes cast)
[9,890 views] Email Article To a Friend View Printable Version
iTunes 11: Clear currently playing track Apps
With iTunes 11, when you start playing an album, all its tracks go into the Up Next queue. In addition, the first track starts playing, and is displayed in the iTunes LCD. If you display the Up Next queue - click the list icon in the iTunes LCD, or press Command-Option-U - you can click on Clear to remove all tracks from the queue. However, the currently playing track still remains in the iTunes LCD, which makes sense.

If you want to clear this track as well, and stop playback, display the Up Next queue and click the Clear button again. This is particularly useful if you want to stop playing the current track and add items to the Up Next queue. Since they don't replace the current track, this is one way to do this. (You could also click on the Next button in the playback controls to just skip over it.)
  Post a comment  •  Comments (0)  
  • Currently 2.67 / 5
  You rated: 1 / 5 (6 votes cast)
[5,551 views] Email Article To a Friend View Printable Version
Keep Yahoo IM Messsages accounts online Apps

If you use a Yahoo IM account in Messages and have a MacBook, you'll find your Yahoo account won't go back online whenever the Mac awakes from sleep mode. Apparently, AOL IM accounts are affected in this way too. Here's one simple solution to the problem that uses crontab to run a simple Applescript that periodically takes all the accounts online.

I write more about this on my blog, including a couple of caveats, but here are the basic steps:

1. Ensure Messages starts at login by right-clicking its Dock icon and Options > Open at Login. Remember that, in OS X Mountain Lion, apps not used for a while will appear to quit automatically, but don’t worry — these steps take that into account.

2. Open a Terminal window. You’ll find Terminal in the Utilities folder of the Applications list within Finder.

3. At the command-line prompt, type crontab -e

4. This will open your (probably) empty crontab file within the vi text editor. Press I to switch to insert mode, so you can type text. Then copy and paste the following, which is all one line:

*/15 * * * * osascript -e 'tell application "System Events" to tell application "Messages" to log in'

Note that if you copy and paste the line, the quotation/single quote marks might be “curly,” depending on which browser you use. This will stop the command working. You might need to delete the quotes, then type them again using your keyboard.

The command causes the AppleScript we specify to run every 15 minutes, which seems reasonable to me because I became a little wary that any more frequent running of the command might impact battery life of my MacBook. But you can change the 15 at the start of the line to any other value, such as 5 minutes.

5. Press Escape, then type :wq which will save the file and quit the editor.

That’s it. You can test it however you wish. Perhaps you might want to take all your accounts offline, then wait up to 15 minutes to find that you’re back online automatically in the background.

[kirkmc adds: I haven't tested this.]
  Post a comment  •  Comments (6)  
  • Currently 2.29 / 5
  You rated: 1 / 5 (7 votes cast)
[5,106 views] Email Article To a Friend View Printable Version
Re-enable old style auto-save for TextEdit (with a real "Save As..."). System 10.8
While better than Lion's behavior, the lack of a true "Save As..." in Mountain Lion frustrates me. I never really saw anything wrong with the old style Autosave feature, where a temporary file gets saved periodically until you close the original file. I liked being able to edit a document and then retroactively apply all changes since the last save to a new file with a different name and location from the old file.

This is what's wrong with the "Duplicate" command, which, when it duplicates the file, includes all the changes since the last save. This forces the user to be prescient about what sorts of changes they may want to make to the file at some point in the future, whereas the old "Save As..." helpfully allows you to move all your recent changes to a different file. Unfortunately for most Apple applications, you are stuck with the new behavior. However, for TextEdit, there appears to be a way to revert to the software's Autosave and "Save As... " to that used by computers since the dawn of time.

In this hint I described how to turn off the auto-save feature for an application, which at least in TextEdit causes the true "Save As..." menu item to re-appear in the File menu and enables the Command-Shift-S shortcut to act as the real "Save As...," not "Duplicate."

When doing this however, there was one problem: the new sandboxing "feature" of OS X does not allow the old auto-save feature of TextEdit to make changes to the document's working directory, so you get annoying pop-up error messages every time TextEdit tries to make the Autosave file. Here how you can fix that.

WARNING: We will be replacing the developer's code signature for TextEdit in this hint. If you have qualms about disabling security features on your computer, stop reading here.

First, open a Terminal window and make a back-up of the application, in case we break something:

cd /Applications


Now, we're going to use codesign to force (-f) the application to use a alternate signing identity (-s). The one we'll use is the dash (-) sign identity. This means the code will use an ad-hoc signing identity, which supposedly means that significant restrictions apply (see the man page for codesign ), but it does seem to allow TextEdit to write to a user's directory so it seems like in this case it's significantly unrestricting the app's permissions. Note that when you do this next step, it will reset the preferences for TextEdit. Also note the second dash after the dash-s, "-s-":

sudo codesign -f -s-

The normal way to disable the new auto-save is the following:

defaults write ApplePersistence -bool no

But I couldn't get that to work. The only thing I could think of to do was get rid of the lockfile (not sure this part is needed?) and then copy TextEdit's .plist file to a directory where I could write to it, and then copy it back. Note that in this next part, I am putting a copy of the .plist lockfile and the .plist itself into root's home directory (/var/root) before doing things to them:

sudo mv /Library/Preferences/ /var/root

sudo cp /Library/Preferences/ /var/root

sudo cp /Library/Preferences/ ~

cd ~

sudo open

Change ApplePersistence from YES to NO. Save, and go back to the Terminal Window.

sudo mv /Library/Preferences/

That's it! Now go enjoy your favorite text editor behaving the way it should be. This trick won't work for any other applications (e.g., Keynote); the "Save As..." menu item doesn't reappear when you disable the ApplePersistence.

[kirkmc adds: I haven't tested this. The warning at the beginning should be sufficient for anyone squeamish about trying something like this.]
  Post a comment  •  Comments (14)  
  • Currently 2.54 / 5
  You rated: 1 / 5 (13 votes cast)
[9,245 views] Email Article To a Friend View Printable Version
Sync calendars to an older iPod iPod
I have a perfectly serviceable 5th generation iPod nano (2009-2010). Unfortunately, every time a new major version of iTunes is released, this iPod loses part of its usability.

In an earlier hint, I showed one way to restore the ability to sync Contacts. With the release of iTunes 11, Apple has also removed the ability to sync Calendars. Under the Info tab for my nano, I now see these incorrect and misleading messages:

"No contacts are available on this computer."
"No calendars are available on this computer."

Here are two ways to remedy that situation. In Calendar, select a calendar in the sidebar, then choose File > Export > Export... and direct the output to the Calendars folder on your older iPod. Repeat this operation for all the calendars you wish to export. (File > Export > Calendar Archive... also works, but on the iPod, all events will appear under All Calendars. If you have a lot of calendars or a lot of events, this option may make it hard to navigate through.)

I tried several ways to create an AppleScript to automate the above procedure, but it turns out that Calendar is not scriptable enough to get the desired result. The script below produces an .ics file for each calendar in the sidebar, but on the iPod everything still appears under All Calendars. It would take a "real programmer" to recreate the proper export format that the manual method produces.
-- set ipodCalPath to "/Calendars/"
-- for instance:
set ipodCalPath to "/Volumes/Chris Schram’s iPod/Calendars/"

tell application "Calendar"
		do shell script ("rm -rf " & (quoted form of ipodCalPath) & "*")
	end try
	delay 5 -- so Calendar is fully launched and shell script is finished
	set allCals to calendars
	repeat with oneCal in allCals
		set thisName to name of oneCal & ".ics"
		set thisUID to uid of oneCal
		set thisPath to (do shell script "find ~/Library/Calendars -maxdepth 2 -name " & thisUID & ".calendar") & "/Events"
		set newPath to quoted form of (ipodCalPath & thisName)
			do shell script ("cat " & thisPath & "/*.ics > " & newPath)
		on error
			do shell script ("cp -rf " & thisPath & " " & newPath)
		end try
	end repeat -- with oneCal in allCals
	say "done exporting calendars"
	-- quit -- application "Calendar" (Optional; you choose)
end tell -- application "Calendar"

  Post a comment  •  Comments (1)  
  • Currently 3.00 / 5
  You rated: 1 / 5 (9 votes cast)
[4,712 views] Email Article To a Friend View Printable Version
Approximating iTunes DJ in iTunes 11 Apps
iTunes 11 removed iTunes DJ (neé Party Shuffle), in which it was possible to queue up a random subset of your library or of a selected playlist, and change the queue with a click of the "Refresh" button. At first it seemed as though this was gone completely, but after some fiddling it appears you can get most of the functionality back as part of the new Up Next feature.

First the basics: Starting from a playlist, just click the shuffle icon (the intersecting arrows) in the header of the playlist view, not the shuffle icon in the iTunes LCD. However, there is no shuffle icon when you view your entire music library, so you'll have to fake it by creating a smart playlist with the condition "Media kind is music," with live updating turned on.

Click list icon at the right of the iTunes LCD to view the Up Next queue. The clock icon in that list shows recently played tracks, like the dimmed portion of the old iTunes DJ interface. You can re-order songs in Up Next by dragging them around, and new items can be added to the top of the queue form anywhere in your library using the contextual menu, just like you could in iTunes 10, or by clicking the > icon that displays when you hover your cursor over a track.

What may not be obvious is how to replicate the function of the Refresh button. To do this, click the shuffle icon in the header of your playlist view again.

Now for the caveats:
  • Clicking that shuffle icon again stops the currently playing song, rather than creating a new queue as iTunes DJ did.
  • You have to click on the Up Next list icon again to see the results (or use the new Command-Option-U shortcut), rather than them being immediately visible.
  • Even with shuffle set to songs (Controls > Shuffle > By Songs), you will still see tracks from the same album show up in the list in sequence fairly often. There used to be a way to control this, but I've forgotten and can't seem to find it now.
Perhaps comments on this hint will reveal ways to overcome those issues.

[kirkmc adds: I was initially very confused by Up Next, but I've figured it out, and it's quite practical for queuing up music. However, you can only see 20 songs in the queue, which can be a bit limiting. So it's not a real replacement for iTunes DJ, and this hint does help a bit. Personally, I never used it to play music from my entire library, so the current implementation works for me.]
  Post a comment  •  Comments (13)  
  • Currently 2.67 / 5
  You rated: 3 / 5 (6 votes cast)
[17,522 views] Email Article To a Friend View Printable Version
Control the Finder with the Terminal UNIX
There are several ways to open a Terminal window to the current directory in the Finder. But wouldn't it be useful if you could do the reverse and open a Finder window to the current Terminal directory? Well, you can, and you can completely control the Finder from the terminal.

I have put the code on github with full instructions on how to set it up. It works by using bash_completion, .bash_profile with some applescript to control the Finder, .inputrc and .bash_aliases.

Here are some of the features:
  • Changing a directory in the Terminal opens the same directory in the Finder.
  • You can change the Finder window view from the Terminal (column, list, icon views).
  • It is case insensitve, you can press Tab for menu completion, and Shift-Tab to expand bash aliases.
  • Open a Terminal directory to the current Finder window.
This code will work with both the and iTerm2 and should work with older macs as well

[kirkmc adds: I haven't tested this, but it sounds very useful.]
  Post a comment  •  Comments (11)  
  • Currently 2.80 / 5
  You rated: 4 / 5 (10 votes cast)
[11,060 views] Email Article To a Friend View Printable Version
Display just one calendar quickly Apps
Sometimes I want to quickly disable all calendars and to display just one, for example, to see upcoming birthdays in month view.

Calendar Help says:

"To show or hide the events on all calendars, hold down the Command key while you click any calendar’s checkbox in the Calendar list."

But if you hold Command and Option, then click a calendar, you achieve exactly what I want: this hide all other calendars except the one you want to see. You can then Command-click another calendar to show them all again.
  Post a comment  •  Comments (3)  
  • Currently 3.92 / 5
  You rated: 3 / 5 (13 votes cast)
[5,681 views] Email Article To a Friend View Printable Version