Tag: Mac OS X

When you get an iPod, you’re faced with many decisions: should I put mostly movies on it? Which songs should I use? Should I manually manage the music, or can I leave it as automatic syncing?

While I can’t help you pick which tunes your iPod will contain, I can help you decide which method to use. Each has its own benefits and drawbacks, and can make using your iPod even more enjoyable.
Read More »

Tagged with: , , , , , ,

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: , , , , ,


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: , , ,