<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Get Info: #automation</title>
    <description>Posts tagged “automation” — Blog of independent game and app developer Matt Sephton. Featuring vintage Macintosh, game development, digital artwork, Japanese esoterica, video game reviews, hacks and tips, and much more.</description>
    <link>https://blog.gingerbeardman.com/tag/automation/</link>
    <atom:link href="https://blog.gingerbeardman.com/tag/automation/index.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Mon, 06 Jul 2026 14:37:40 +0000</pubDate>
    <lastBuildDate>Mon, 06 Jul 2026 14:37:40 +0000</lastBuildDate>
    <generator>Jekyll v4.4.1</generator>

    
      
        <item>
          <title>Transparent compression with Folder Actions in macOS</title>
          <description>&lt;p&gt;I just wired this up for my own &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;build&lt;/code&gt; folder—where my current project is quietly piling up data—and figured it was worth writing down. The same trick works on any big codebase, a pile of assets, or a crowded &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/Applications&lt;/code&gt; folder. I generally use it on folders that don’t have frequent churn, but do have large or compressible things added to them often enough.&lt;/p&gt;

&lt;p&gt;It relies on &lt;em&gt;transparent file system compression&lt;/em&gt; (sometimes called AFSC), which has been built into macOS for years. It’s nothing like a zip archive: files aren’t bundled up or locked away—they keep their names, stay right where they are, and every app opens them as normal. macOS simply stores them compressed on disk and unpacks them on the fly as they’re read. The only thing that changes is the &lt;em&gt;size on disk&lt;/em&gt;—often dramatically. Apps can even launch more quickly, which is why all Mac App Store downloads already have this sort of filesystem compression applied.&lt;/p&gt;

&lt;p&gt;The classic tool for this is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;afsctool&lt;/code&gt;, but these days I reach for &lt;a href=&quot;https://github.com/Dr-Emann/applesauce&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;applesauce&lt;/code&gt;&lt;/a&gt;, a modern Rust rewrite. It compresses much faster by working on blocks in parallel, uses less memory, and writes safely via atomic temp-file renames so you can’t corrupt a file.&lt;/p&gt;

&lt;p&gt;Rather than run it by hand in the Terminal or from a &lt;a href=&quot;/2024/07/30/taking-command-of-the-context-menu-in-macos/&quot;&gt;context menu&lt;/a&gt; every time, we can wire it into a &lt;em&gt;Folder Action&lt;/em&gt; so files get compressed the moment they land in a folder.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;install-applesauce&quot;&gt;Install applesauce&lt;/h2&gt;

&lt;p&gt;Two easy options:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Homebrew (lives in a custom tap, not the core repo)&lt;/span&gt;
brew &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;Dr-Emann/homebrew-tap/applesauce

&lt;span class=&quot;c&quot;&gt;# or the standalone installer, if you&apos;d rather skip brew&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;--proto&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;=https&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--tlsv1&lt;/span&gt;.2 &lt;span class=&quot;nt&quot;&gt;-LsSf&lt;/span&gt; https://github.com/Dr-Emann/applesauce/releases/latest/download/applesauce-cli-installer.sh | sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then find where it landed:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;which applesauce
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On Apple silicon &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;brew&lt;/code&gt; installs to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/opt/homebrew/bin/&lt;/code&gt;; older Intel Macs use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/usr/local/bin/&lt;/code&gt;. We’ll need that path in a moment.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;create-the-folder-action&quot;&gt;Create the Folder Action&lt;/h2&gt;

&lt;p&gt;Folder Actions is a built-in macOS directory watcher. We’ll build one with Automator:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Open &lt;em&gt;Automator&lt;/em&gt;, choose &lt;em&gt;New Document&lt;/em&gt;, pick &lt;em&gt;Folder Action&lt;/em&gt;.&lt;/li&gt;
  &lt;li&gt;At the top, set &lt;em&gt;receives files and folders added to:&lt;/em&gt; to your target folder.&lt;/li&gt;
  &lt;li&gt;If Automator drops in a &lt;em&gt;Get Selected Finder Items&lt;/em&gt; action, delete it—Folder Actions already pass incoming files along, so keeping it breaks the pipeline.&lt;/li&gt;
  &lt;li&gt;Search the sidebar for &lt;em&gt;Run AppleScript&lt;/em&gt; and drag it into the workflow.&lt;/li&gt;
  &lt;li&gt;Paste this, swapping the path if yours differs:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;language-applescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;parameters&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
	&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;repeat&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;theItem&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
		&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
			&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;do shell script&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/opt/homebrew/bin/applesauce compress &quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;quoted form&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;POSIX&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;theItem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
		&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
	&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;repeat&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
	&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Save (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Cmd + S&lt;/code&gt;) as something descriptive like “Compress”, drop a few files into the folder, and macOS shrinks them behind the scenes. Pretty easy!&lt;/p&gt;

&lt;p&gt;Just for you, here’s one I made earlier: &lt;a href=&quot;https://cdn.gingerbeardman.com/files/Compress.workflow.zip&quot;&gt;Compress.workflow.zip&lt;/a&gt; (93 KB)&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;no-sudo-required&quot;&gt;No sudo required&lt;/h2&gt;

&lt;p&gt;Changing a file’s compression &lt;em&gt;sounds&lt;/em&gt; like root territory, but &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;applesauce&lt;/code&gt; only writes to your own user-owned folders, so it isn’t. That means no Touch ID or password prompts breaking your flow, and nothing running with privileges it doesn’t need.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;what-triggers-it&quot;&gt;What triggers it&lt;/h2&gt;

&lt;p&gt;Worth knowing before you lean on this: a Folder Action only fires when items are &lt;em&gt;added&lt;/em&gt; to the folder (or removed from it), never when a file already sitting inside it changes. It isn’t recursive either—only the top level of the folder is watched, not the contents of any subfolders. That’s &lt;a href=&quot;https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/WatchFolders.html&quot;&gt;straight from Apple’s docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/Applications&lt;/code&gt; that comes with a catch. When an app updates itself it usually swaps in a whole new &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.app&lt;/code&gt; bundle, which is technically a new item—but Folder Actions have always been flaky at noticing changes made by anything other than Finder, and updaters move files into place programmatically. So don’t count on self-updating apps getting re-compressed for you. When you want to be sure, drag the app out and back in, or just re-run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;applesauce compress&lt;/code&gt; on it by hand.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;choosing-the-algorithm&quot;&gt;Choosing the algorithm&lt;/h2&gt;

&lt;p&gt;By default &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;applesauce compress&lt;/code&gt; uses &lt;em&gt;LZFSE&lt;/em&gt;, Apple’s fast and well-balanced algorithm—a good pick for almost everything. Two others are available:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;em&gt;LZVN&lt;/em&gt; — tuned for 64-bit, very fast to decompress.&lt;/li&gt;
  &lt;li&gt;&lt;em&gt;ZLIB&lt;/em&gt; — slower to compress, but often the best ratio.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Force one with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-c&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-applescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;do shell script&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/opt/homebrew/bin/applesauce compress -c LZVN &quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;quoted form&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;POSIX&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;theItem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;applesauce info &amp;lt;path&amp;gt;&lt;/code&gt; will report the ratio and algorithm any file ended up with. You beauty!&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;managing-setup&quot;&gt;Managing setup&lt;/h2&gt;

&lt;p&gt;Saving from Automator attaches the action to the folder you chose, but you can wire the same “Compress” action to more folders—or check it’s switched on if nothing’s happening—from the &lt;em&gt;Folder Actions Setup&lt;/em&gt; dialog. Right-click any folder in Finder and choose &lt;em&gt;Services → Folder Actions Setup…&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tick &lt;em&gt;Enable Folder Actions&lt;/em&gt; (bottom-left).&lt;/li&gt;
  &lt;li&gt;Add the folder you want watched to the left column.&lt;/li&gt;
  &lt;li&gt;Pick “Compress” from the actions on the right.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now anything you drop into that folder gets squeezed automatically, no matter how it got there.&lt;/p&gt;

&lt;p class=&quot;tofigure&quot;&gt;&lt;img src=&quot;https://cdn.gingerbeardman.com/images/posts/folder-actions.png&quot; alt=&quot;IMG&quot; title=&quot;Compress workflow applied to build folder&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;results&quot;&gt;Results&lt;/h2&gt;

&lt;p&gt;We can confirm the savings with Finder’s Get Info (wouldn’t that be a great name for a blog?). The &lt;em&gt;Size&lt;/em&gt; line still reports the full, uncompressed size—that’s what apps see—while the smaller figure in brackets is what the folder now actually takes up &lt;em&gt;on disk&lt;/em&gt;. The gap between the two is the saving.&lt;/p&gt;

&lt;p&gt;For finer detail, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;applesauce info &amp;lt;path&amp;gt;&lt;/code&gt; prints the exact ratio and algorithm file by file.&lt;/p&gt;

&lt;p class=&quot;tofigure&quot;&gt;&lt;img src=&quot;https://cdn.gingerbeardman.com/images/posts/folder-actions-compression-results.png&quot; alt=&quot;IMG&quot; title=&quot;Check size on disk&quot; /&gt;&lt;/p&gt;
</description>
          <author>by Matt Sephton</author>
          <pubDate>Wed, 01 Jul 2026 15:44:00 +0000</pubDate>
          <link>https://blog.gingerbeardman.com/2026/07/01/transparent-compression-with-folder-actions-in-macos/</link>
          <guid isPermaLink="true">https://blog.gingerbeardman.com/2026/07/01/transparent-compression-with-folder-actions-in-macos/</guid>
        </item>
      
    
      
        <item>
          <title>Intelligent Agent Technology: Open Sesame! (1993)</title>
          <description>&lt;p&gt;After years of unsuccessful attempts to find the name of a long-forgotten app through Google, I tried pasting my query into Gemini:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“Back in my teens I saw a software demo for a Mac/Windows app that tracked what you were doing and offered to complete repetitive tasks for you. Like renaming all files in a folder it would interrupt after a few and offer to do the rest. Maybe late 80s or early 90s.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Gemini instantly responded with the app by name and with references. (out of all the services I tried, ChatGPT was the only other one to identify the app correctly.)&lt;/p&gt;

&lt;p&gt;Open Sesame! was “the world’s first intelligent software assistant for the Macintosh. It observes how you work, learns your repetitive patterns, and then offers to do them for you. Automatically.”&lt;/p&gt;

&lt;p class=&quot;tofigure&quot;&gt;&lt;img src=&quot;https://cdn.gingerbeardman.com/images/posts/open-sesame.jpg&quot; alt=&quot;IMG&quot; title=&quot;Open Sesame! software reduces computer-use complexity&amp;lt;br&amp;gt;by relieving users of many routine tasks.&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;one-thousand-and-one-nights&quot;&gt;One Thousand and One Nights&lt;/h2&gt;

&lt;p&gt;I remember seeing a demo of Open Sesame! in the early/mid-1990s. Although the demo failed—the Macintosh was supposed to prompt the user to continue renaming a series of files in sequence—the concept left a lasting impression on me.&lt;/p&gt;

&lt;p&gt;Over the years I’ve tried to find the event I saw the app at, the app itself, or any other information. I asked other classic Macintosh enthusiasts. Time after time I failed to find the answer.&lt;/p&gt;

&lt;p&gt;So I find it delightfully circular that in 2025 I am using the “ai” benefits of machine learning to find out the name of an app built around machine learning in 1993.&lt;/p&gt;

&lt;hr /&gt;

&lt;p class=&quot;tofigure&quot;&gt;&lt;img src=&quot;https://cdn.gingerbeardman.com/images/posts/open-sesame-ad-1993.jpg&quot; alt=&quot;IMG&quot; title=&quot;Advertisement in MacWorld (December 1993)&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;download&quot;&gt;Download&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://macintoshgarden.org/apps/open-sesame-11&quot;&gt;Open Sesame! 1.1 at Macintosh Garden&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;further-reading&quot;&gt;Further Reading&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://archive.org/details/MacWorld_9308_August_1993/page/n26/mode/2up?q=%22open+sesame%22&quot;&gt;MacWorld: MacBulletin&lt;/a&gt; (August 1993)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://archive.org/details/MacWorld_9309_September_1993/page/n37/mode/2up?q=%22open+sesame%22&quot;&gt;MacWorld: News&lt;/a&gt; (September 1993)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://archive.org/details/MacWorld_9312_December_1993/mode/2up?q=%22open+sesame%22&quot;&gt;MacWorld: advertisement&lt;/a&gt; (December 1993)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://archive.org/details/MacWorld_9405_May_1994/page/n85/mode/2up?q=%22open+sesame%22&quot;&gt;MacWorld: review of version 1.02&lt;/a&gt; (May 1994)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://archive.org/details/MacWorld_9406_June_1994/mode/2up?q=%22open+sesame%22&quot;&gt;MacWorld: advertisement&lt;/a&gt; (June 1994)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://archive.org/details/MacWorld_9412_December_1994/mode/2up?q=%22open+sesame%22&quot;&gt;MacWorld: price of version 1.1&lt;/a&gt; (December 1994)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://archive.org/details/MacWorld_9508_August_1995/page/n203/mode/2up?q=%22open+sesame%22&quot;&gt;MacWorld: get Open Sesame! free when buying a keyboard&lt;/a&gt; (August 1995)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://spinoff.nasa.gov/spinoff1996/56.html&quot;&gt;NASA Spinoff: Intelligent Agent Technology&lt;/a&gt; (&lt;a href=&quot;https://archive.org/details/1991_20210720_202107/1996/page/n96/mode/1up&quot;&gt;scan&lt;/a&gt;) (1996)&lt;/li&gt;
&lt;/ul&gt;
</description>
          <author>by Matt Sephton</author>
          <pubDate>Sat, 31 May 2025 15:33:00 +0000</pubDate>
          <link>https://blog.gingerbeardman.com/2025/05/31/intelligent-agent-technology-open-sesame-1993/</link>
          <guid isPermaLink="true">https://blog.gingerbeardman.com/2025/05/31/intelligent-agent-technology-open-sesame-1993/</guid>
        </item>
      
    
      
        <item>
          <title>The menu bar items I use on macOS</title>
          <description>&lt;p&gt;This is an expanded version of &lt;a href=&quot;https://talk.macpowerusers.com/t/787-revisiting-our-mac-menu-bars/40090/44?u=gingerbeardman&quot;&gt;a post I made to the MPU Talk forum&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;visible&quot;&gt;Visible&lt;/h2&gt;

&lt;p&gt;Those I often need to interact with:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.macbartender.com&quot;&gt;Bartender&lt;/a&gt; (menu bar item manager; old version)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://sindresorhus.com/dato&quot;&gt;Dato&lt;/a&gt; (alt clock and calendar with timezones; old version)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://bjango.com/mac/istatmenus/&quot;&gt;iStat Menus&lt;/a&gt; (network speed; old version)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://xbarapp.com&quot;&gt;xBar&lt;/a&gt; (custom menu items powered by my own shell scripts)
    &lt;ul&gt;
      &lt;li&gt;Proxy Status&lt;/li&gt;
      &lt;li&gt;Software Sales Stats&lt;/li&gt;
      &lt;li&gt;GitHub Issues&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;/2025/02/08/automating-the-cleaning-of-macos-specific-files-on-eject/&quot;&gt;Eject Volumes&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.caffeine-app.net&quot;&gt;Caffeine&lt;/a&gt; (used to set Mac not to sleep)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;hidden&quot;&gt;Hidden&lt;/h2&gt;

&lt;p&gt;Those I infrequently need to interact with:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Bookmark manager hotkey app (my own, unreleased; supports &lt;a href=&quot;https://github.com/sissbruecker/linkding&quot;&gt;linkding&lt;/a&gt;)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://apps.apple.com/us/app/otp-auth/id1471867429&quot;&gt;OTP Auth&lt;/a&gt; (2FA codes)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://c-command.com/toothfairy/&quot;&gt;ToothFairy&lt;/a&gt; (Bluetooth/AirPods helper)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/Pyroh/Fluor&quot;&gt;Fluor&lt;/a&gt; (specify function key behaviour per-app)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;always-hidden&quot;&gt;Always Hidden&lt;/h2&gt;

&lt;p&gt;Those I rarely need to interact with:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/odlp/bluesnooze&quot;&gt;Bluesnooze&lt;/a&gt; (turns off Bluetooth when Mac sleeps)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://micropixels.software/apps/neptunes&quot;&gt;NepTunes&lt;/a&gt; (audio scrobbler and track notifications)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://rogueamoeba.com/soundsource/&quot;&gt;SoundSource&lt;/a&gt; (custom audio equaliser with my hearing profile audiogram)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.deepl.com/en/macos-app&quot;&gt;DeepL&lt;/a&gt; (instant translation of copied text when doing Cmd+C twice)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.alfredapp.com&quot;&gt;Alfred&lt;/a&gt; (multi-tool with clipboard history and custom workflows)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/apexskier/DefaultBrowser&quot;&gt;Default Browser&lt;/a&gt; (open links in your most recently used/active browser)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://freemacsoft.net/tiles/&quot;&gt;Tiles&lt;/a&gt; (window manager)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.hammerspoon.org&quot;&gt;Hammerspoon&lt;/a&gt; (my own window and workspace manager functions written in Lua)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🤓&lt;/p&gt;
</description>
          <author>by Matt Sephton</author>
          <pubDate>Fri, 21 Mar 2025 18:08:00 +0000</pubDate>
          <link>https://blog.gingerbeardman.com/2025/03/21/the-menu-bar-items-i-use-on-macos/</link>
          <guid isPermaLink="true">https://blog.gingerbeardman.com/2025/03/21/the-menu-bar-items-i-use-on-macos/</guid>
        </item>
      
    
      
        <item>
          <title>Automating the cleaning of macOS-specific files on Eject</title>
          <description>&lt;blockquote&gt;
  &lt;p&gt;I’ve released a native macOS app that does all this script can do &lt;em&gt;and much more!&lt;/em&gt;&lt;br /&gt;Read all about it: &lt;a href=&quot;https://www.gingerbeardman.com/apps/driveaway/&quot;&gt;gingerbeardman.com/apps/driveaway/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Dot underscore &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;._&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.DS_Store&lt;/code&gt; files are macOS-specific metadata cruft generated for foreign filesystems (like FAT32 or exFAT) that are not usually needed for disks that are mainly used on other platforms. Digital cameras, music players, e-book readers, and handheld gaming devices can get confused when they encounter these odd files during file system parsing and directory listing. The problem is compounded if the devices naïvely process files by looking only at the file extension as they will then see the dot underscore version of a file as a duplicate and try to preview/play/open it.&lt;/p&gt;

&lt;p&gt;For years I’ve used an app called &lt;a href=&quot;https://web.archive.org/web/20250208072547/https://macpaw.com/cleanmymac&quot;&gt;CleanMyDrive&lt;/a&gt; to remove such files, but &lt;a href=&quot;https://macpaw.com/news/cleanmydrive-no-longer-developed&quot;&gt;it was discontinued in October 2023&lt;/a&gt;. I continued to use it until it recently stopped working completely …so I needed to find an alternative solution. There are some apps on the Mac App Store that look like they’ll do the trick, but I don’t really want to spend the time buying and trialling multiple apps to find one that fits my usage habits. I can make one!&lt;/p&gt;

&lt;p&gt;I already use an app called &lt;a href=&quot;https://xbarapp.com&quot;&gt;xbar&lt;/a&gt; for keeping track of my GitHub issues, itch.io sales, network/server status, and more. So I decided to flex my shell script muscles and put together an xbar script to do it.&lt;/p&gt;

&lt;p&gt;The script adds a menu bar item that allows you to:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Eject (click)&lt;/li&gt;
  &lt;li&gt;Unmount (option-click)&lt;/li&gt;
  &lt;li&gt;Eject All (without cleaning, useful when you want to disconnect all drives from your computer)&lt;/li&gt;
  &lt;li&gt;All with a handy notification&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s it! Straight to the point, no frills, functional software.&lt;/p&gt;

&lt;p class=&quot;tofigure&quot;&gt;&lt;img src=&quot;https://cdn.gingerbeardman.com/images/posts/xbar-volumes.png&quot; alt=&quot;IMG&quot; title=&quot; &quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;noscript&gt;&lt;p&gt;&lt;a href=&quot;https://gist.github.com/gingerbeardman/610f22180117ad20465d7c529cc5faa0&quot;&gt;View the source code as a Gist&lt;/a&gt;&lt;/p&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/gingerbeardman/610f22180117ad20465d7c529cc5faa0.js&quot;&gt;&lt;/script&gt;

</description>
          <author>by Matt Sephton</author>
          <pubDate>Sat, 08 Feb 2025 20:45:00 +0000</pubDate>
          <link>https://blog.gingerbeardman.com/2025/02/08/automating-the-cleaning-of-macos-specific-files-on-eject/</link>
          <guid isPermaLink="true">https://blog.gingerbeardman.com/2025/02/08/automating-the-cleaning-of-macos-specific-files-on-eject/</guid>
        </item>
      
    
      
        <item>
          <title>Remote monitoring a web server job queue</title>
          <description>&lt;p&gt;I use some software called &lt;a href=&quot;https://github.com/huginn/huginn&quot;&gt;&lt;em&gt;Huginn&lt;/em&gt;&lt;/a&gt; to do various automated web searching and scraping. One use case is &lt;a href=&quot;/2023/04/10/where-can-i-see-hokusai-great-wave-today/&quot;&gt;checking the status of all the institutions where The Great Wave is currently on view&lt;/a&gt;, or not. I also have it do automatic auction searches for various items I’m looking for, that would otherwise take up a bunch of my time. And much more.&lt;/p&gt;

&lt;h2 id=&quot;huginn-we-have-a-problem&quot;&gt;Huginn, we have a problem&lt;/h2&gt;

&lt;p&gt;Huginn is installed on one of my web servers and does its thing on hourly, every day of the week without fail. Well, that’s not quite true. Sometimes, something happens outside of its control and the job queue gets jammed. It should be able to cope with this event, but for whatever reason it doesn’t. There’s no easy way to tell when this has happened, and the way I usually notice is by my RSS feed appearing less busy than usual. So, the most recent time this happened I promised myself I’d find a solution to monitoring the job queue remotely.&lt;/p&gt;

&lt;h2 id=&quot;help-from-the-community&quot;&gt;Help from the community&lt;/h2&gt;

&lt;p&gt;Another Huginn user &lt;a href=&quot;https://github.com/huginn/huginn/issues/3368#issuecomment-2045510388&quot;&gt;mentioned&lt;/a&gt; that I could send a regular request to &lt;a href=&quot;https://www.healthchecks.io&quot;&gt;healthchecks.io&lt;/a&gt;, which would raise a notification if the requests stopped coming in (a method known as &lt;a href=&quot;https://en.wikipedia.org/wiki/Dead_man%27s_switch&quot;&gt;the Dead man’s switch&lt;/a&gt;) which is exactly what would happen when the job queue is jammed. This was a good idea! Whilst I could be notfications by email or various push notification services, I’d prefer to get my notifications the same way as my server notifications - through &lt;a href=&quot;https://uptimerobot.com&quot;&gt;uptimerobot.com&lt;/a&gt; - so I added that to the process, with the help of &lt;a href=&quot;https://toot.lv/@cuu508/112246652626290022&quot;&gt;Pēteris Caune&lt;/a&gt; the creator of healthchecks.io.&lt;/p&gt;

&lt;p&gt;Here is my final recipe:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;https://healthchecks.io/&quot;&gt;healthchecks.io&lt;/a&gt; to get a Ping URL&lt;/li&gt;
  &lt;li&gt;create a new Huginn Scenario with a Website Agent to request the above Ping URL every hour&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://healthchecks.io/&quot;&gt;healthchecks.io&lt;/a&gt; to get a Status Badge URL (JSON format)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://uptimerobot.com&quot;&gt;uptimerobot.com&lt;/a&gt; Keyword monitor watching the contents of the Status Badge URL (check for keyword “up”, and start incident when keyword does not exist)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And that’s it! Next time the job queue jams, the Uptime Robot app will send me a push notification. I know it works because I tested it—a very important step!&lt;/p&gt;

&lt;h2 id=&quot;future-features&quot;&gt;Future features?&lt;/h2&gt;

&lt;p&gt;Maybe this setup will help me spot a pattern in the queue jams? Or perhaps I can take this further and have the Huginn restart when it gets jammed? As with all these sorts of things, I take it step by step and make one change at a time. Let’s see how it goes.&lt;/p&gt;
</description>
          <author>by Matt Sephton</author>
          <pubDate>Wed, 10 Apr 2024 19:04:00 +0000</pubDate>
          <link>https://blog.gingerbeardman.com/2024/04/10/remote-monitoring-a-web-server-job-queue/</link>
          <guid isPermaLink="true">https://blog.gingerbeardman.com/2024/04/10/remote-monitoring-a-web-server-job-queue/</guid>
        </item>
      
    
      
        <item>
          <title>Where can I see Hokusai’s Great Wave today?</title>
          <description>&lt;p&gt;I’ve been obsessed with &lt;a href=&quot;https://en.wikipedia.org/wiki/The_Great_Wave_off_Kanagawa&quot;&gt;The Great Wave&lt;/a&gt; (or its more literal title: &lt;em&gt;Under the Wave, Off Kanagawa&lt;/em&gt;) since the mid-1990s. This Japanese woodblock print designed by &lt;em&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Hokusai&quot;&gt;Katsushika Hokusai&lt;/a&gt;&lt;/em&gt; is one of the world’s most iconic works of art. You’ve probably seen it crop up in a whole host of scenarios.&lt;/p&gt;

&lt;p class=&quot;tofigure&quot;&gt;&lt;img src=&quot;https://cdn.gingerbeardman.com/images/posts/great-wave-british-museum.jpg&quot; alt=&quot;JPG&quot; title=&quot;One of three early impressions of The Great Wave in the collection of The British Museum&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The interesting thing about woodblock prints is that the original piece of art was destroyed during the act of &lt;a href=&quot;https://www.youtube.com/watch?v=IBcB_dYtGUg&quot;&gt;mass production&lt;/a&gt;. In the case of The Great Wave, there are around 100 known, publicly viewable, early impressions that were made around the time Hokusai was alive. And there are very many impressions made after his death, not to mention modern prints that are not made using woodblocks.&lt;/p&gt;

&lt;p&gt;The trick to seeing one of the early impressions is being in the right place at the right time, because they are sensitive to light and will fade with over-exposure. Most are stored away for several of years, make a brief appearance, and then go back into long-term storage.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=U_025NB8alw&quot;&gt;These early impressions vary&lt;/a&gt; in their details, colours and condition, so it’s worthwhile seeing more than just one. I’ve been lucky enough with timing to get to see two different impressions: the first was at The British Museum back in the early 2000s, and the second at &lt;a href=&quot;https://www.bristolmuseums.org.uk/bristol-museum-and-art-gallery/whats-on/hokusai-hiroshige-japanese-prints/&quot;&gt;Bristol Museum and Art Gallery&lt;/a&gt; in 2018. But in 2021 I missed seeing a different impression at The British Museum, one of three in their collection.&lt;/p&gt;

&lt;p&gt;Missing a viewing made me think about all the impressions in galleries and museums around the world, and which of them might currently be viewable. So I made a list of known impressions, with thanks to &lt;a href=&quot;https://www.britishmuseum.org/sites/default/files/2022-03/korenberg_article-for_hokusai%20_edited_volume_final-2020_accessible.pdf&quot;&gt;Capucine Korenberg at The British Museum&lt;/a&gt; for a head start. I spent time digging up their respective pages across the various museum and gallery online collections, which was the most laborious part of this project. After that I set up some automation using &lt;a href=&quot;https://github.com/huginn/huginn&quot;&gt;Huginn&lt;/a&gt; to alert me when an impression is pulled out of storage and put “on view”. This doesn’t happen very often—every few months or so, if we’re lucky—so it’s a nice surprise when a notification pops up. I also monitor Japanese press releases and news websites. If there’s any interest I’ll write a separate blog post about the automation I put in place for this project.&lt;/p&gt;

&lt;p&gt;Of course, there’s no fun in keeping this to myself so I put together a website containing the places where you can see The Great Wave today:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://greatwavetoday.com&quot;&gt;greatwavetoday.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As well as checking the website you can also subscribe to its RSS feed, so you’ll also receive those lovely surprise notifications! Both the web page and RSS feed are automatically generated.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Thanks to &lt;a href=&quot;https://twitter.com/soleio&quot;&gt;Soleio&lt;/a&gt; for thinking of such a great domain name!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;final-thoughts&quot;&gt;Final thoughts&lt;/h3&gt;

&lt;p&gt;Please do let me know if this project helps you see an early impression of Hokusai’s Great Wave.&lt;/p&gt;

&lt;p&gt;If you’re a museum or gallery and would like to have your impression tracked, please &lt;a href=&quot;https://github.com/gingerbeardman/greatwavetoday/issues/new/choose&quot;&gt;click this link and follow the prompts&lt;/a&gt;.&lt;/p&gt;
</description>
          <author>by Matt Sephton</author>
          <pubDate>Mon, 10 Apr 2023 00:00:00 +0000</pubDate>
          <link>https://blog.gingerbeardman.com/2023/04/10/where-can-i-see-hokusai-great-wave-today/</link>
          <guid isPermaLink="true">https://blog.gingerbeardman.com/2023/04/10/where-can-i-see-hokusai-great-wave-today/</guid>
        </item>
      
    
      
        <item>
          <title>Script to quickly and automatically remux videos on Synology NAS</title>
          <description>&lt;p&gt;I recently set up an old HP ProLiant Microserver N54L as a NAS running Xpenology (Synology DSM 6) and it’s a great little device capable of a lot. It’s also fun to write scripts and configure things to add automation and extra capabilities!&lt;/p&gt;

&lt;p&gt;Here’s a script I wrote that will look for mkv and avi files and quickly copy-remux them as mp4. I do this because my playback setup across Apple devices seems to have an easier time with that type of container.&lt;/p&gt;

&lt;p&gt;As it’s only the container that is being changed: the video content remain the same so there is no change in quality, the remux process takes only seconds, and the file size remains effectively the same. I also set the faststart flag on the mp4 to help it start playing more quickly.&lt;/p&gt;

&lt;h2 id=&quot;outline&quot;&gt;Outline&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Find mkv and avi files&lt;/li&gt;
  &lt;li&gt;Remux the files with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ffmpeg&lt;/code&gt; to mp4&lt;/li&gt;
  &lt;li&gt;If successful move the old file to Recycle Bin (so it can be recovered if needed)&lt;/li&gt;
  &lt;li&gt;Log results to a file and fire off some notifications&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;usage&quot;&gt;Usage&lt;/h2&gt;

&lt;p&gt;I have set this script to run daily using &lt;em&gt;Task Scheduler &amp;gt; Scheduled Task &amp;gt; User-defined script&lt;/em&gt; using the full path to the script, which should be located in a Scripts sub-directory inside your video directory.&lt;/p&gt;

&lt;p&gt;After the first successful run I decided to comment out all notifications except the failure one, as that’s all I really need to act on. But feel free to set it up as you wish. You could even change it to remux from mp4 to mkv.&lt;/p&gt;

&lt;h2 id=&quot;source&quot;&gt;Source&lt;/h2&gt;

&lt;noscript&gt;&lt;p&gt;&lt;a href=&quot;https://gist.github.com/gingerbeardman/508fccef1827e717d6100b2ac6dcfc37&quot;&gt;View the source code as a Gist&lt;/a&gt;&lt;/p&gt;&lt;/noscript&gt;
&lt;script src=&quot;https://gist.github.com/gingerbeardman/508fccef1827e717d6100b2ac6dcfc37.js&quot;&gt;&lt;/script&gt;

&lt;h2 id=&quot;bonus&quot;&gt;Bonus&lt;/h2&gt;

&lt;p&gt;I’ve only recently begun to set the faststart movflag on my mp4 files, which meant my older videos did not have it set. So here’s an additional script, &lt;a href=&quot;https://gist.github.com/gingerbeardman/59413f3b9d06e0d7a8ccbf3119e7dbdf&quot;&gt;faststart.sh&lt;/a&gt;, to set the faststart movflag on all mp4 files.&lt;/p&gt;

&lt;p&gt;Note: if you have a lot of videos this script will take a long time to complete. You can estimate about 30 seconds per video, for a total of (all your videos divided by two) minutes.&lt;/p&gt;
</description>
          <author>by Matt Sephton</author>
          <pubDate>Wed, 12 Jan 2022 00:00:00 +0000</pubDate>
          <link>https://blog.gingerbeardman.com/2022/01/12/script-to-quickly-and-automatically-remux-videos-on-synology-nas/</link>
          <guid isPermaLink="true">https://blog.gingerbeardman.com/2022/01/12/script-to-quickly-and-automatically-remux-videos-on-synology-nas/</guid>
        </item>
      
    
      
        <item>
          <title>Automating interactions using Apple Events</title>
          <description>&lt;p&gt;&lt;a href=&quot;/2021/04/17/turning-an-ipad-pro-into-the-ultimate-classic-macintosh/&quot;&gt;As I’ve previously mentioned&lt;/a&gt;, UltraPaint and artWORKS share a lot of DNA so their structure is effectively identical, including the tool palette. This is a good thing as I intend to automate tool selection in both apps and I’ll take any help 30-year-old software wants to send my way!&lt;/p&gt;

&lt;p&gt;Chapter 6 in the book “The Automatic Mac” (1992, &lt;a href=&quot;https://vintageapple.org/macbooks/&quot;&gt;download&lt;/a&gt;) details a number of ways of scripting graphics programs. They use Canvas as an example, which is great because that is a very close relative to the artWORKS and UltraPaint apps that I use. The book informed a lot of what I’m doing here, though my approach differs because of my available tools and personal preference.&lt;/p&gt;

&lt;h2 id=&quot;simply-clicking&quot;&gt;Simply Clicking&lt;/h2&gt;

&lt;p&gt;My first thought was to try the naive way of selecting tools by just clicking them! If the tool palettes are positioned in the same place (this can also be automated) then macros can simply click at specific screen locations to select a tool. This approach works well for both apps. But this is a very fragile way of automating interactions—if windows are inadvertently moved the automation will break. So, there’s definitely room for improvement.&lt;/p&gt;

&lt;h2 id=&quot;going-deeper&quot;&gt;Going Deeper&lt;/h2&gt;

&lt;p&gt;According to period Apple documentation (&lt;a href=&quot;https://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=&amp;amp;ved=2ahUKEwiIr_OAzYXwAhXErHEKHR_sAcYQFjAAegQIChAD&amp;amp;url=https%3A%2F%2Fdeveloper.apple.com%2Flegacy%2Flibrary%2Fdocumentation%2Fmac%2Fpdf%2FInterapplication_Communication%2FIntro_to_IAC.pdf&amp;amp;usg=AOvVaw0WKA5J59562fzTuOMZ58PG&quot;&gt;PDF&lt;/a&gt;, &lt;a href=&quot;http://mirror.informatimago.com/next/developer.apple.com/documentation/mac/IAC/IAC-94.html&quot;&gt;HTML&lt;/a&gt;) a means of automation was introduced in System 7:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The interapplication communication (IAC) architecture provides a standard and extensible mechanism for communication among Macintosh applications. The IAC architecture makes it possible for your application to&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;provide automated copy and paste operations between your application and other applications&lt;/li&gt;
    &lt;li&gt;be manipulated by means of scripts&lt;/li&gt;
    &lt;li&gt;send and respond to Apple events&lt;/li&gt;
    &lt;li&gt;send and respond to high-level events other than Apple events&lt;/li&gt;
    &lt;li&gt;read and write blocks of data between applications&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;Sounds perfect—my idea of a good time!&lt;/p&gt;

&lt;h2 id=&quot;apple-events&quot;&gt;Apple Events&lt;/h2&gt;

&lt;p&gt;To support AppleScript, apps were required to offer suites of supported messages and mechanisms. These are advertised through the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;aete&lt;/code&gt; resource. ResEdit shows this data as raw hex, unless you install a template to enable it to make sense of it. Resorcerer supports it out of the box. There are a bunch of other tools that can display the data in a human readable way such an Apple-created &lt;a href=&quot;https://staticky.com/mirrors/ftp.apple.com/developer/Development_Kits/AppleScript/Development_Tools/Aete_Editor_Stack_1.0b3/&quot;&gt;HyperCard stack&lt;/a&gt;, a third-party app called &lt;a href=&quot;https://macintoshgarden.org/apps/eightyrez&quot;&gt;EightyRez&lt;/a&gt;, and automation tool &lt;a href=&quot;https://macintoshgarden.org/apps/quickeys-353&quot;&gt;QuicKeys&lt;/a&gt; to name just a few.&lt;/p&gt;

&lt;p&gt;QuicKeys sounded ideal as it lets me query the data, using a set of dropdown menus, and use it to specify automation to try out the Apple Events way of selecting a tool. It worked first time! But it was slow, and there was a distracting loss of window focus as the macro was executed.&lt;/p&gt;

&lt;p&gt;In search of something better turned to my favourite classic automation tool: KeyQuencer. I’d previously searched trough various archives for any available macros, so had a vague memory there was something out there I might be able to use. I dug up AESend, an Apple Events extension for KeyQuencer.&lt;/p&gt;

&lt;p&gt;I used QuicKeys GUI to set up the initial Apple Events call, as it allows you to pick options from drop-down lists. Then I used the Capture AE control panel to decode the Apple Events call into something human readable that I could adapt for use in KeyQuencer. I’d still take that approach for any new Apple Events.&lt;/p&gt;

&lt;p&gt;The result was much faster Apple Events sending and no distracting window focus flickering.&lt;/p&gt;

&lt;h2 id=&quot;two-in-one&quot;&gt;Two-in-One&lt;/h2&gt;

&lt;p&gt;The end result is a macro of two parts: the first section operates artWORKS using Apple Events, continuing without complaint if the app is not open, and the second section operates UltraPaint using simple mouse clicks.&lt;/p&gt;

&lt;p class=&quot;tofigure&quot;&gt;&lt;img src=&quot;https://cdn.gingerbeardman.com/images/posts/automating-apple-events.png#pixel&quot; alt=&quot;PNG&quot; title=&quot;Example of a KeyQuencer Macro that works in both artWORKS and UltraPaint&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I plan to adding support for Canvas 3.x at some point as this shares Apple Events support with artWORKS.&lt;/p&gt;

&lt;h2 id=&quot;investigation&quot;&gt;Investigation&lt;/h2&gt;

&lt;p&gt;According to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;aete&lt;/code&gt; resource description in both artWORKS and Canvas, selection of Internal Tools using Apple Events is limited to 10 seemingly random tools. This made no sense to me, so I tried specifying higher tools and this experimentation proved that all 18 internal tools are indeed available. I guess the description had been truncated at some point?&lt;/p&gt;

&lt;p&gt;Some time later I read “The Automatic Mac” again and it shows a more complete list of tool values! The order seems to be based on the tool palette in Canvas.&lt;/p&gt;

&lt;p&gt;Even so, I went the extra mile to complete a list of both internal and external tools, shown below.&lt;/p&gt;

&lt;h3 id=&quot;internal-tools-btol&quot;&gt;Internal Tools (btol)&lt;/h3&gt;

&lt;table id=&quot;deneba-btol&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Name&lt;/th&gt;
      &lt;th&gt;shor&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;ArcRect&lt;/td&gt;
      &lt;td&gt;7&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Arrow&lt;/td&gt;
      &lt;td&gt;1&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;BezierCurve&lt;/td&gt;
      &lt;td&gt;10&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Brush&lt;/td&gt;
      &lt;td&gt;14&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Eraser&lt;/td&gt;
      &lt;td&gt;17&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Free Hand&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Lasso&lt;/td&gt;
      &lt;td&gt;11&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Line&lt;/td&gt;
      &lt;td&gt;3&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Marquee&lt;/td&gt;
      &lt;td&gt;12&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Oval&lt;/td&gt;
      &lt;td&gt;6&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Paint Bucket&lt;/td&gt;
      &lt;td&gt;15&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Paint Object Creator&lt;/td&gt;
      &lt;td&gt;18&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Pencil&lt;/td&gt;
      &lt;td&gt;16&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Polygon&lt;/td&gt;
      &lt;td&gt;9&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Rect&lt;/td&gt;
      &lt;td&gt;4&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;RoundRect&lt;/td&gt;
      &lt;td&gt;5&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Spray Can&lt;/td&gt;
      &lt;td&gt;13&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Text&lt;/td&gt;
      &lt;td&gt;2&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h3 id=&quot;external-tools-etol&quot;&gt;External Tools (etol)&lt;/h3&gt;

&lt;table id=&quot;deneba-etol&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Name&lt;/th&gt;
      &lt;th&gt;long&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Coil&lt;/td&gt;
      &lt;td&gt;CoiL&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Concentric Circles&lt;/td&gt;
      &lt;td&gt;CCir&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Cube&lt;/td&gt;
      &lt;td&gt;Cube&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Cylinder&lt;/td&gt;
      &lt;td&gt;cyln&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Dimensioning&lt;/td&gt;
      &lt;td&gt;DIMN&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Doughnuts&lt;/td&gt;
      &lt;td&gt;doug&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Fractals&lt;/td&gt;
      &lt;td&gt;Flin&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Gradient Fill&lt;/td&gt;
      &lt;td&gt;ObFl&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;GridMaker&lt;/td&gt;
      &lt;td&gt;grid&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Mover&lt;/td&gt;
      &lt;td&gt;MovE&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Multigon&lt;/td&gt;
      &lt;td&gt;NGON&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Namestamp&lt;/td&gt;
      &lt;td&gt;NamE&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Parallel Lines&lt;/td&gt;
      &lt;td&gt;Paln&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Point Rotate&lt;/td&gt;
      &lt;td&gt;PtRt&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;QuickTime&lt;/td&gt;
      &lt;td&gt;QkTm&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Registration Marks&lt;/td&gt;
      &lt;td&gt;regP&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Resistor&lt;/td&gt;
      &lt;td&gt;ResT&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Sounder&lt;/td&gt;
      &lt;td&gt;sndT&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Spiral&lt;/td&gt;
      &lt;td&gt;Spir&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Split&lt;/td&gt;
      &lt;td&gt;Splt&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Star&lt;/td&gt;
      &lt;td&gt;STAR&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Timestamp&lt;/td&gt;
      &lt;td&gt;TimE&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h3 id=&quot;related-posts&quot;&gt;Related posts&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;/2021/04/17/turning-an-ipad-pro-into-the-ultimate-classic-macintosh&quot;&gt;Turning an iPad Pro into the Ultimate Classic Macintosh&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2021/04/21/building-basiliskii-for-ios/&quot;&gt;How to install BasiliskII on your iPad&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Exploring Custom Keyboards and Automation&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2021/03/28/changing-the-size-of-toolbar-items-using-resedit/&quot;&gt;Optimising Macintosh app toolbars for touch&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2021/04/24/macintosh-drawing-software-compared/&quot;&gt;Macintosh drawing software compared&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2021/04/25/mixing-external-tools-across-deneba-software/&quot;&gt;Mixing External Tools across Deneba software&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2021/04/30/my-system-7-software-choices/&quot;&gt;My System 7 software choices&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/2021/05/03/interoperability-of-system-7-and-ios/&quot;&gt;About the interoperability of System 7 and iOS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
          <author>by Matt Sephton</author>
          <pubDate>Mon, 19 Apr 2021 00:00:00 +0000</pubDate>
          <link>https://blog.gingerbeardman.com/2021/04/19/automating-interactions-using-apple-events/</link>
          <guid isPermaLink="true">https://blog.gingerbeardman.com/2021/04/19/automating-interactions-using-apple-events/</guid>
        </item>
      
    

  </channel>
</rss>
