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.
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 com.apple.dock 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 com.apple.dock 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.]
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.)
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.
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:
ditto TextEdit.app TextEdit.backup.app
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- TextEdit.app
The normal way to disable the new auto-save is the following:
defaults write com.apple.TextEdit 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:
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.]
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) & "*")
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)
do shell script ("cp -rf " & thisPath & " " & newPath)
end repeat -- with oneCal in allCals
say "done exporting calendars"
-- quit -- application "Calendar" (Optional; you choose)
end tell -- application "Calendar"
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.]
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 Terminal.app and iTerm2 and should work with older macs as well
[kirkmc adds: I haven't tested this, but it sounds very useful.]
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.
The AppleScript I provided previously for this doesn't work in iTunes 11, but Up Next can be used instead.
I previously submitted this AppleScript to provide a way to play one song then stop playback in iTunes. The script doesn't work in iTunes 11, but Up Next can be used instead. Also, using this method, it can be accomplished entirely from the keyboard. (It's important to note that "All controls" must be checked at the bottom of the Keyboard Shortcuts tax tab in the Keyboard pane of System Preferences.)
The objective is to be able to select a single song in a playlist, make it start playing, then prevent playback from continuing after the song has been played in its entirety. This can be done in iTunes 11 by selecting a song to play using alternating key presses of Tab, Shift-Tab, Up Arrow and Down Arrow. The next step is most important: open the Up Next list with Command-Option-U, and check to be sure no titles appear in the list (if there are any, press Tab until the "Clear" button is highlighted, then press the spacebar to "click" that button; otherwise press Escape or Command-Option-U again to exit the list), then press Return to play the song. You can pause and resume the song with spacebar if desired, and playback will still stop at the end of the song as long as you don't add anything to the Up Next list in the meantime.
[kirkmc adds: This does seem a bit complicated, but there's no way to use AppleScript to manipulate the Up Next queue, unfortunately.]