Mac OS X hints
Permanently Unhide Library
As you may know, and as mentioned in this hint, the Library folder can be made visible again by running the following command in Terminal:
/usr/bin/chflags nohidden ~/Library
Apple keeps making the folder invisible again with every System update, so it gets tedious re-running the above script. You can automate this by adding a Login Item with an AppleScript "script application" containing the following code:
do shell script "/usr/bin/chflags nohidden ~/Library"
Read detailed instructions for this hint, and download a ready-made script application file on the ...
New poll: Does your main Mac have an SSD?
So, what about you? Does your main Mac - the one you use most - have an SSD? Feel free to post in the comments to the poll which model, whether you bought it with the Mac or installed it yourself, or any other comments you may have about SSDs.
Vote in the poll
Two AppleScripts for unmounting, mounting local disk volumes
The first is an improved version of the original AppleScript which presents a dialog box from which a selection of local volumes to be ejected can be made. An example of its usefulness might be that it provides a reliable method for quickly ejecting a MacBook's mounted local volumes for users on the go. I've configured it as a "Run AppleScript" step for an Automator-based Mac OS X Service called "Unmounter" and assigned it the keyboard shortcut of (Command-Control-Shift-E) in System Preferences on my system.
The second is a more robust version of the AppleScript included in my first reply to the original hint topic. It attempts to automatically unmount all unmountable local volumes, and if it finds none, attempts to mo ...
Copy partially played Audiobooks to a playlist
However, if a track's "Remember playback position" option is set (and most audiobooks have this set by default) the track's AppleScript bookmark property will contain the number of seconds that a track has advanced before being stopped. Thus, any track with a bookmark value greater than zero would have been partially played.
Here is an AppleScript that will copy all the tracks in the "Books" library to a new playlist named "Partially Played". Each time it is run it will update the "Partially Played" playlist. property nameOfPlaylist : "Partially Played" tell application "iTunes" try set thePlaylist to some playlist whose name is nameOfPlaylist on error set thePlaylist to (make playlist with properties {nam ...
Open certain preference panes with quick shortcut
Drag files from Safari 5 Downloads popup
Click on an icon in the Downloads popup and drag it to any folder, or even onto a Dock icon to launch a file you've just downloaded with a specific application.
[kirkmc adds: This seems obvious, but there's no hint here for it. There have been hints about double-clicking an icon in the Downloads window to open it, copying and pasting URLs from the Downloads window, and the keyboard shortcut to show the Downloads popup (Command-Option-L).]
Save all of your Terminal activity to a file
Open Terminal's preferences.
Go to Settings, then Shell. You can choose here to run a command at startup. You could create a simple log of your session using the following: /usr/bin/script ~/Desktop/Terminal.log This will log everything you do and append it to the log file.
I like to keep my history so instead I wrote this small script that archives previous sessions by renaming the file with a date/time string. I then set Terminal.app to run at startup the following command: ~/Desktop/logger.sh Here's the script: #!/bin/bash # logger.sh # Log everything you do in Terminal. #* Formatted date & time string. FORMATTED_DATE=`/bin/date "+%Y-%m-%d%H%M%S"` #* Archive the previous file /bin/cp -f ~/Desktop/Terminal ...
Remove rubber band scrolling in most apps
It works in applications like:
- Finder
- Preview
- TextEdit
- Xcode
In Terminal type: defaults write -g NSScrollViewRubberbanding -int 0 It should work after you relaunch your applications.
To undo this change, run this command in Terminal: defaults delete -g NSScrollViewRubberbanding [kirkmc adds: Works as described. I haven't tested many apps, so feel free to post which o ...
View full track info in iOS Music App
[kirkmc adds: Nice. I hadn't heard of this before, but searching the web shows that it is not totally unknown. Since it hasn't shown up here before, it's worth posting.]
Allow custom URL protocols in Lion Server wiki pages
Remove scrolling elasticity in Xcode
Copy this Xcode plugin to the following directory:
~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/
You should create the directories if needed.
Enjoy!
Scroll PDF in Finder in Column View
[kirkmc adds: Several points. First, in Column View, you need to have Show Preview Column checked in the View settings. When you select a PDF, its first page shows in the Preview column. From there, you hover your cursor and see two arrow buttons. You can either click on these or scroll.
This might be useful if you just need a quick glance at a file, but once you've selected the PDF, you can view it in Quick Look by pressing the space bar, which lets you see the document at full size.]
Moving custom paper sizes from Snow Leopard to Lion
I was recently asked to see if I could copy over the custom page sizes from a Snow Leopard machine over to a Lion machine.
While finding the right file in ~/Library/Preferences (com.apple.print.custompapers.plist) wasn't so difficult, it turned out that the Snow Leopard version of the file is binary encoded while the Lion version is not. (It may be that this file was grandfathered in from a previous system.)
XCode for Lion can convert the file to a regular XML text file:
- Open the file in Xcode.
- Choose File > Duplicate.
- In the Save dialog box, select "Property List XML" from the Format drop-down list.
Moving the regular text version over to Lion and putting it into the Preferences folder gave us a way to copy a huge list of custom paper sizes from one designer to another quickly and easily.
AppleScript for selecting local volumes to unmount
Option-up arrow and Option-down arrow cycle through sent messages in iChat
[kirkmc adds: I actually spotted this a while ago. I'm not sure why it's there; and I don't really see any use for it, other than, perhaps, to find a text you sent to someone without scrolling in the window, and copy that to send to someone else. This works in Lion; can anyone confirm that whether works in earlier versions of OS X or not?]
Build a service to count characters, words and paragraphs
Launch Automator and create a new Service. Add the Execute an AppleScript script action, then paste the following code: on run {input, parameters} try set MyText to input as string set NombreSignes to the number of characters of MyText set NombreMots to the number of words of MyText set NombrePara to the number of paragraphs of MyText set LeResultat to "The selected text contains :" & return & "- " & NombreSignes & " sign(s) ;" & return & "- " & NombreMots & " word(s) ;" & return & "- " & NombrePara & " paragraph(s)." display dialog LeResultat buttons {"OK"} default button 1 with icon n ...
Use Logitech N305 number pad with Mac
So, I set out in search of a standalone number pad I could use with my Mac. While I don't work with numbers often, when I do my accounting, it's a pain to have to type numbers from the top row of the keyboard. I looked at a number of models - both wired and wireless - and found what seemed to be the best choice: Logitech's N305. This works with Logitech's Unifying Receiver, is fairly compact, and, according to Logitech, works for three years with a pair of batteries.
But the N305 does not support Macs. Fortunately, in reviews for the product on Amazon, a number of people posted a solution. Download the free KeyRemap4MacBook, a preference p ...
Reduce the size of Google Chrome
[kirkmc adds: Interesting. On my Mac, in the bundle, in Contents > Versions, there are, indeed, two versions of Chrome. This presumably has something to do with Chrome's silent updating. (Queries on Twitter suggest that this is the norm; a number of people replied that theirs was around 220 MB, as was mine.) Make sure you keep the one with the highest version number. You could also, of course, just download a new copy.
If you want to turn off this automatic updating, s ...
Get rid of intermittent SSH_AUTH_SOCKET environment variable from SSHKeychain
I used to use a great little program called SSHKeychain to maintain my ssh world on OS X. Even after Apple's keychain started dealing with ssh-agent properly, I still kept SSHKeychain around for the convenience of maintaining my ssh tunnel configurations in one place.
However, there was an occasional mismatch between the SSHKeychain way of doing things and the Apple keychain way, and SSHKeychain seemed to have fallen into disrepair, with no maintenance (on SourceForge at least) since 2007.
A few months back, I finally got rid of SSHKeychain, and started having problems.
There was apparently a phase-of-the-moon dependent race condition (somewhere) that clobbered the Apple keychain setting of SSH_AUTH_SOCK with a setting left over from SSHKeychain. This man ...
New poll: Which is your favorite Mac?
You can vote in the poll, and feel free to post comments on that page about why you selected a specific model.