Undocking from an Apple Thunderbolt Display

Posted by: on Sep 23, 2011 | 6 Comments

Apple finally has a “dock” for its notebook computers. That dock is the Thunderbolt display. The Thunderbolt display has its own power cable for charging your Apple notebook, as well as a Thunderbolt cable to serve as the single connection for display, ethernet, sound, USB, and Firewire connectivity. This means you can connect your Firewire, USB, and Thunderbolt drives into the back of the display and have them all “dock” when you plug in the single Thunderbolt cable.

Unfortunately, unplugging the monitor may not be so easy if you have several external drives. By using Applescript, you can basically create an “undock” application that you can simply open when you want to unplug the display. I’ve also provided the app for you: Undock.app

  1. Open “AppleScript Editor.app” found in the Applications -> Utilities folder
  2. Paste the following code into “Untitled” applescript window:
    tell the application "Finder"
    	eject (every disk whose ejectable is true)
    end tell
  3. Go to File -> Save. Name the file “Undock” and choose “Application” as the file format. You can now run this from Spotlight or create a shortcut in your dock if you prefer; just as with any other application. Your external drives will be ejected after running this script.

6 Comments

  1. mark
    September 24, 2011

    thanks – this is what apple should have provided
    works great

    Reply
  2. darkj2k
    September 25, 2011

    All drives connecting to Mac directly will also be ejected?

    Reply
    • Shawn
      September 25, 2011

      Yes, that is correct, it works for drives connected directly to the Mac as well. Of course, if you don’t want a particular drive to be ejected, you could edit the script.

      Reply
      • darkj2k
        September 25, 2011

        Can you show me how just eject disk connected to TB only by your script? I am new to Mac OS. Thanks in advance.

        Reply
        • Shawn
          September 26, 2011

          There is not a way that I know of (via Applescript) to determine if a disk is connected to the display or the computer. Why are you wanting to only eject disks connected to the display? You could do it by listing the disk names in a script like this:

          tell the application “Finder”
          set disksToEJect to {“Seagate FreeAgent External”, “Another Disk”}
          eject (every disk whose name is in disksToEJect)
          end tell

          Just specify all the disks you want to eject in the disksToEject list.

          Reply
  3. Undocking thunderbolt – Apple script — Susarla.com
    October 4, 2011

    [...] for a solution i found this little apple script that does the job really well (thanks to Shawn at Chompingatbits.com). This is a simple script that basically sends message to the machine to eject all attached drive [...]

    Reply

Leave a Reply