Category: Macs

I’ve been frustrated recently because external hard drives connected to my MacBook have refused to unmount. After resorting to restarting before trying again, I posted my problem to a number of online forums.

Knowledgeable member of the Macworld forums oddlot answered my question with a Unix command called hdiutil that can force eject a drive.

I took this command and wrote a quick Applescript that displays a list of the connected drives and force ejects the one you choose.


tell application "Finder"
  set startupDisk to "Macintosh HD"
  --suppress errors if there are no other drives connected
  try
    set allDrives to the name of every disk whose name does not contain startupDisk
  on error
    display dialog "There are no other drives to unmount"
    return
  end try
  
  set selectedDrive to "Cookie Monster"
  --create the list of drives to unmount
  set selectedDrive to {choose from list allDrives with prompt "Choose the drive to unmount:"} as text
  
  --remove spaces from disk names
  set OldDelims to AppleScript's AppleScript's text item delimiters
  set AppleScript's AppleScript's text item delimiters to " "
  set newText to text items of selectedDrive
  set AppleScript's AppleScript's text item delimiters to "" & space
  set theText to newText as text
  set AppleScript's AppleScript's text item delimiters to OldDelims
  
  try
    --shell script that force ejects the selected hard drive
    do shell script "hdiutil eject -force /Volumes/" & theText
  end try

end tell

I linked this up to a Butler trigger, so now if a drive is uncooperative, I can activate this script with one key combination.

If you wish to use this script as a simple application, copy the code listed into a Script Editor window (found in /Applications/Applescript). You’ll likely not need to change anything, but if your startup disk is anything other than Macintosh HD, you need to change the beginning variable startupDisk. Choose Save As from the File menu and pick Application from the dropdown menu. This will create an application that you can easily double click whenever you need it.

UPDATE: I realized after I posted this that the functionality is broken when the disk contains spaces in the name. The code posted here has been corrected.
[tags]Applescript, Automator, programming[/tags]

Tagged with: , , , , ,

This is part 1 of upgrading your MacBook. Part 2 is moving the data to the new drive.

When you purchase a MacBook, the options for hard drive space are 80GB, 120GB, or now, 250GB. I went with the stock 80, but now, more than a year later, I want more. What to do? Why, install your own hard drive, of course! I picked up a 250 GB drive at a local store for $100, and am now in the process of moving all my extra items on this ginormous (for a laptop) drive.

Since I am certain there are more people interested in doing this, here is part 1 of a two part tutorial on what you need to do to get your MacBook up and running with a larger drive (part 2 is moving the data).

The first thing you will need, naturally, is a hard drive. As I mentioned, I picked up a 2.5″ SATA drive with 250 GB and 5400 RPM at a local store for $100. This is a very good price, in my mind, and it fits the bill nicely. Just remember that those are the specs you need to get: 2.5″ laptop drive, 5400 RPM, SATA connection. 7200 RPM drives also work.

With a hard drive available, you are now ready to begin replacing the innards to your computer.
Read More »

Tagged with: , , , , ,


If you’re like me, you wait for a while whenever new technology arrives. We didn’t get a DVD player until they had been on the scene for a few months, and we didn’t have high speed internet until the price dropped way down. In fact, there’s probably a Betamax player somewhere in the basement.

I waited until Revision 2 to pick up an Airport Extreme base station. The gigabit feature was the reason I waited. I probably didn’t notice much difference since there are only 2 wired computers on the network, and only 1 has Gigabit ethernet, but waiting for Product 2.0 is generally a good way to go. The router I was replacing is an Airport Express base station that has been my entire wireless setup since 2004, and it has been an excellent solution. With the Airport Extreme, I played around with the settings, and learned that I had better reception for my iPod touch if I used Wireless G with both routers instead of a single Wireless N base station.

With that in mind, here is a tutorial for using two Airport base stations to create a single distributed network.

Steps

  1. Configure Main base station
  2. Configure Remote base station

Read More »

Tagged with: , , , , ,


OS X Leopard is a great operating system, but having used it since it’s arrival in October, I’ve found a number of things I think Apple should fix, in increasing order of randomness:

  1. Network Sharing
  2. Time Machine configuration
  3. Workgroup configuration
  4. WiFi dropouts
  5. Spaces configuration

Read More »

Tagged with: , , , ,

Applescript
If you’re still using a POP email account, you should have a look at other providers. Gmail recently began offering IMAP service for its clients, and it is a much better way of organizing your email.

IMAP is different from POP email because it keeps all messages and attachments on the central Gmail servers. This means that regardless of how or where you download and view messages – whether on your computer, iPod, iPhone or other device – you see the same inbox, with the same unread/read messages. This is different than POP because POP requires you to download all new messages onto your computer, which makes retrieval from different places awkward.

I use Apple’s Mail.app for all of my email duties, and its integration with IMAP accounts presents some unique challenges. One of the things it does is create a complete deposit for all the messages ever sent with your account in a special folder. In itself not a bad thing, in fact it can be quite handy, but it means that you now have duplicate copies of most of your messages, and twice as many unread messages.

Until Apple and Google coordinate their efforts and make Gmail as seamless on the Mac as they have with the iPod/iPhone, there are a few things you can do to make the experience easier. One of the ways is to use this hint from MacOSXHints.com. It gets rid of the duplicate mailboxes in Gmail. Next, you have to find a way to get rid of the double mail count. To do this, I came up with a simple Applescript that is evaluated whenever there is a new message.
Read More »

Tagged with: , , ,