<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>MacOS Shortcut on Jingyuan</title>
        <link>https://jingyuan-zheng.github.io/tags/macos-shortcut/</link>
        <description>Recent content in MacOS Shortcut on Jingyuan</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-US</language>
        <copyright>Jingyuan Zheng</copyright>
        <lastBuildDate>Sat, 08 Aug 2026 14:00:00 +0200</lastBuildDate><atom:link href="https://jingyuan-zheng.github.io/tags/macos-shortcut/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>Eject All DMG and ISO Images on macOS with One Shortcut</title>
            <link>https://jingyuan-zheng.github.io/p/eject-disk-images/</link>
            <pubDate>Sat, 08 Aug 2026 14:00:00 +0200</pubDate>
            <guid>https://jingyuan-zheng.github.io/p/eject-disk-images/</guid>
            <description>&lt;p&gt;This post introduces &lt;strong&gt;Eject Disk Images&lt;/strong&gt;, a small macOS Shortcut that ejects mounted DMG, ISO, and other disk images managed by macOS in one go, while leaving ordinary external drives alone.&lt;/p&gt;&#xA;&lt;p&gt;After installing an app from a DMG, the installer window often stays mounted in Finder. One image is easy to eject, but several leftover volumes quickly turn into a small cleanup job. This open-source project gives that job a single, reusable shortcut.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-eject-disk-images&#34;&gt;What is Eject Disk Images?&#xA;&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Eject Disk Images&lt;/strong&gt; is a macOS Shortcut with an AppleScript version for the same task. It looks for disk images that macOS is currently managing through &lt;code&gt;DiskImages&lt;/code&gt; and &lt;code&gt;hdiutil&lt;/code&gt;, then asks macOS to eject the eligible images.&lt;/p&gt;&#xA;&lt;p&gt;It can handle common formats such as:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;.dmg&lt;/code&gt; installer images;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;.iso&lt;/code&gt; images;&lt;/li&gt;&#xA;&lt;li&gt;other mounted images that appear in macOS&amp;rsquo;s disk-image list.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;It is especially useful after installing several Mac apps, opening an ISO temporarily, or simply finding a collection of installer volumes still visible in Finder.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-it-doesand-what-it-does-not-do&#34;&gt;What it does—and what it does not do&#xA;&lt;/h2&gt;&lt;p&gt;The safety boundary is deliberately simple:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It targets disk images managed by macOS&amp;rsquo;s disk-image service.&lt;/li&gt;&#xA;&lt;li&gt;It does not intentionally eject ordinary USB drives, external hard disks, or external SSDs.&lt;/li&gt;&#xA;&lt;li&gt;It uses the normal, non-forced eject process by default.&lt;/li&gt;&#xA;&lt;li&gt;If a disk image is still being used by an open file or application, macOS may leave it mounted instead of interrupting that work.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;This means the shortcut is designed for clearing away finished installers, not for forcibly removing storage or overriding macOS&amp;rsquo;s protection. Close anything still using a busy image, then run the shortcut again if necessary.&lt;/p&gt;&#xA;&lt;h2 id=&#34;install-the-shortcut&#34;&gt;Install the Shortcut&#xA;&lt;/h2&gt;&lt;p&gt;The quickest option is the iCloud installation link:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;https://www.icloud.com/shortcuts/c4e2e57ed36d4b4db518576ab9f6f425&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;Get Eject Disk Images from iCloud&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;When macOS opens the Shortcuts app, choose &lt;strong&gt;Get Shortcut&lt;/strong&gt; or &lt;strong&gt;Add Shortcut&lt;/strong&gt;. You can also visit the &lt;a class=&#34;link&#34; href=&#34;https://github.com/Jingyuan-Zheng/Eject-Disk-Images&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;Eject-Disk-Images GitHub repository&lt;/a&gt; and download &lt;code&gt;Eject Disk Images.shortcut&lt;/code&gt; from the project files.&lt;/p&gt;&#xA;&lt;p&gt;The project uses only tools already included with macOS, so there is no separate utility to install. The Shortcut version requires the built-in &lt;strong&gt;Shortcuts&lt;/strong&gt; app.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-use-it&#34;&gt;How to use it&#xA;&lt;/h2&gt;&lt;ol&gt;&#xA;&lt;li&gt;Open the &lt;strong&gt;Shortcuts&lt;/strong&gt; app, or run the shortcut from Spotlight, Siri, the menu bar, or a keyboard shortcut.&lt;/li&gt;&#xA;&lt;li&gt;Run &lt;strong&gt;Eject Disk Images&lt;/strong&gt; after you have finished installing or using a DMG, ISO, or another disk image.&lt;/li&gt;&#xA;&lt;li&gt;Let macOS eject the images it can safely detach.&lt;/li&gt;&#xA;&lt;li&gt;If one remains because it is busy, close the related file or app and run the shortcut again.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;You do not need to select each volume in Finder first. The shortcut checks the current list of mounted disk images when it runs, so it is useful even when several installer volumes have accumulated.&lt;/p&gt;&#xA;&lt;h2 id=&#34;an-applescript-option&#34;&gt;An AppleScript option&#xA;&lt;/h2&gt;&lt;p&gt;The repository also includes the readable source file &lt;code&gt;Eject Disk Images.scpt&lt;/code&gt;. Open it with macOS &lt;strong&gt;Script Editor&lt;/strong&gt; to inspect or run it. If you prefer a standalone app, Script Editor can export the AppleScript as an application that you can double-click whenever you want to clean up mounted disk images.&lt;/p&gt;&#xA;&lt;p&gt;The Shortcut is the easiest choice for most people. The AppleScript version is useful if you want to understand the project, customise it, or keep a separate app in a convenient location.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-it-works-in-plain-language&#34;&gt;How it works, in plain language&#xA;&lt;/h2&gt;&lt;p&gt;Under the hood, the project asks macOS which disk images are currently managed by &lt;code&gt;hdiutil&lt;/code&gt;, collects their device identifiers, and passes them back to macOS&amp;rsquo;s ordinary detach process. Because it starts with the disk-image list rather than scanning every mounted volume, it can distinguish installer images from regular external storage.&lt;/p&gt;&#xA;&lt;p&gt;That is also why it is safer than a broad command that tries to eject everything connected to the Mac. The shortcut focuses on the problem it is meant to solve: clearing mounted macOS disk images after they are no longer needed.&lt;/p&gt;&#xA;&lt;p&gt;The source code and MIT license are available on &lt;a class=&#34;link&#34; href=&#34;https://github.com/Jingyuan-Zheng/Eject-Disk-Images&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;GitHub&lt;/a&gt;. If you regularly install Mac apps from DMG files or open ISO images, download it once and keep the shortcut ready for the next cleanup.&lt;/p&gt;&#xA;</description>
        </item></channel>
</rss>
