When you install a new app in OS X, it usually comes in the form of a DMG file that you have to then mount, eject, and delete. This simple Automator service simplifies the process, ejecting the disk image and deleting its DMG file in one fell swoop.
Here’s how to create this very simple service:
- Open up the Automator application and select “Service”.
- Change the top two dropdown menus to receive “No Input” from the “Finder”.
- In the left sidebar, drag the “Run AppleScript” action into the right pane. Copy the following code into the box:
tell application "Finder" set selection_list to selection if (count selection_list)
- Save the service as whatever you want (like “Eject & Delete DMG”) and exit Automator.
Now, when you’re done using a DMG file, you can just click on it, then go to Finder > Services > Eject & Delete DMG to eject the image and delete the DMG with one click. If you really want to make it fast, you can go to System Preferences > Keyboard > Keyboard Shortcuts and give your service a handy keyboard shortcut. Note that this doesn’t work if you select the DMG in the Finder sidebar; you have to select it in an actual Finder window (or on the desktop). Hit the link to read more.
Auto-Delete a DMG File When Ejecting a Disk Image [Mac OS X Hints]
Leave a Reply
You must be logged in to post a comment.