<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>hi, it&#39;s mike</title>
    <link>https://mike.puddingtime.org/tags/automation/</link>
    <description>Recent content on hi, it&#39;s mike</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <managingEditor>mike@puddingtime.org (mike)</managingEditor>
    <webMaster>mike@puddingtime.org (mike)</webMaster>
    <copyright>© 2026, mike</copyright>
    <lastBuildDate>Thu, 29 Jun 2023 08:59:25 -0700</lastBuildDate>
    <atom:link href="https://mike.puddingtime.org/tags/automation/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Daily notes for 2023-06-29</title>
      <link>https://mike.puddingtime.org/posts/2023-06-29-daily-notes/</link>
      <pubDate>Thu, 29 Jun 2023 08:59:25 -0700</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2023-06-29-daily-notes/</guid>
      <description>RE Himalayan stuff. The hideousness of motorcycle marketing. Obsidian daily page automation with Shortcuts. Camera bags. Automation for slowness.</description>
      <content:encoded><![CDATA[<h2 id="more-himalayan">More Himalayan</h2>
<p>Evidently RE Himalayans have a widespread problem with parasitic drains owing to a few things, including weird wiring of the gear sensor. The net effect is batteries that get chewed through in a week of sitting. People do a bunch of things to address it, from finding third-party components to replace the factory stuff from RE, to rewiring the gear sensor, to even putting mechanical bypasses on the negative pole of their batteries. A battery tender is enough to help, too, though I sort of hate having one sitting out in the driveway.</p>
<p>There&rsquo;s also a cheap dongle you can order from Hitchcocks to do the rewiring for you. I ordered one hoping it&rsquo;ll address my Himalayan&rsquo;s particular issues. If I&rsquo;m to sell it, I&rsquo;d like to say &ldquo;no need for a constant tender!&rdquo;</p>
<p>I also ordered an Antigravity battery. Those things are cool: They keep some reserve power back. When they sense drain on the battery taking it below its ability to start the bike, the battery shuts down. Press a button and it recharges the main cells enough for a couple of starts.</p>
<p>There&rsquo;s a newer RE dealer up in St. John now, and I want to go up and talk to them. The service I got at the dealership I bought the bike from was pretty bad and sort of grudging. They had a real &ldquo;if you wanted it to all work perfectly, why didn&rsquo;t you spend more&rdquo; attitude, which helped me realize that what they <em>want</em> to do is sell you a Harley, but it&rsquo;s useful to them to have some RE&rsquo;s sitting on the floor for when people come in and can&rsquo;t countenance sixteen grand. There&rsquo;s the RE for less than $7000 out the door, and the way motorcycle fever works is that you&rsquo;ve rolled into that dealership ready buy <em>something</em> no matter what. (Well, not me &ndash; I got it all out of my system with my first 170cc scooter, and am probably on a local dealership blacklist for filling out quote forms then never returning calls.)</p>
<h2 id="the-h-is-for-hideous-or-horny-take-your-pick-on-what-the-d-is-for">The &ldquo;H&rdquo; is for &ldquo;Hideous.&rdquo; Or &ldquo;Horny.&rdquo; Take your pick on what the &ldquo;D&rdquo; is for.</h2>
<p>Trying to look up the price for a Harley Street Bob I ended up on <a href="https://www.harley-davidson.com/us/en/motorcycles/street-bob.html">the product page</a>. Jesus Christ.</p>
<p>Raising a kid I was sensitized to the aspirational nature of children&rsquo;s television/marketing. Like, was <em>iCarly</em> about teenage kids? Yes. But Nickelodeon didn&rsquo;t think fifteen-year-olds were watching. It knew eleven-year-olds were watching. The ads told you what the real viewer demographic was.</p>
<p>Harley is doing this in reverse: The male model is &ldquo;good-looking guy, a little salt and pepper in the beard.&rdquo; The female model is younger. Plausibly-deniably younger. Not enough to be lurid. Not enough, in a marriage where decisions about things like motorcycles are made jointly, to trigger too much anxiety, and possibly even aspirational for the spouse who&rsquo;s okay with a t-shirt that reads &ldquo;If you can read this, my old lady fell off.&rdquo;</p>
<p>It&rsquo;s not marketing for 30-year-olds who aspire to be 45-year-olds. It&rsquo;s marketing for 60-year-old men who aspire to much younger women. Wow it&rsquo;s a fine line between &ldquo;plausible deniability&rdquo; and &ldquo;feels icky.&rdquo; The local Harley dealership where I got the Himalayan picks up the slack with a &ldquo;Summer Solstice Bike Night&rdquo; that includes a bikini bike wash. I guess that&rsquo;s for the <em>very rare</em> instances where merely riding around atop your new Hog didn&rsquo;t magnetically lasso an old lady onto the pillion. And if all they&rsquo;re doing is rolling up to the bikini car wash a few times between June and August, <a href="https://www.washingtonpost.com/news/tripping/wp/2017/10/16/baby-boomers-who-made-motorcycles-cool-are-also-at-higher-risk-of-fatalities-aaa-says/">it&rsquo;s probably keeping the mortality rate down</a>.</p>
<h2 id="obsidian-actions-and-shortcuts">Obsidian Actions and Shortcuts</h2>
<p>You can do a lot with the Obsidian URL scheme and Apple&rsquo;s Shortcuts, but it&rsquo;s a little less fiddly with <a href="https://obsidian.actions.work">Actions for Obsidian</a>, which offers a bunch of Shortcuts actions that handle things like appending text to notes, making new notes, etc. I dusted off an old Shortcut I had that used the URL scheme and refactored it to work with Actions for Obsidian and it is much cleaner.</p>
<p>The workflow:</p>
<ul>
<li>Pops up a dialog with all my appointments for the day</li>
<li>I check the appointments I want an entry for in my daily page</li>
<li>If there&rsquo;s no daily page, the workflow creates it</li>
<li>Appends my appointments for the day to the Notes section of my daily page</li>
</ul>
<p>I currently just have a simple template for those meetings:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-markdown" data-lang="markdown"><span class="line"><span class="cl"><span class="gh"># Meeting Name 
</span></span></span><span class="line"><span class="cl">(attendees)
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="gu">## What&#39;s the most important thing about this meeting?
</span></span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">## How do you want to show up? </span></span></code></pre></div>
<p>It&rsquo;s at slight cross purposes with my static &ldquo;Today&rdquo; page, which I developed thinking I wasn&rsquo;t going to do daily pages. During my layoff, daily pages and journal entries were sort of the same thing, and I was doing all my journaling in encrypted org-journal files. I decided to keep my journal in org-journal, where I have a safe space for writing whatever I want. Daily pages are a little more &ldquo;look ahead and log things I don&rsquo;t care about other people reading (much).&rdquo; So, I think I&rsquo;ll move some of my Today page templating into my daily pages so they become a record of activity: Notes and tasks created on that day and that loose &ldquo;looking ahead&rdquo; calendar forecast I automated.</p>
<h2 id="camera-bags">Camera bags</h2>
<p><a href="https://www.kickstarter.com/projects/moment/the-everything-bags-cameras-tech-and-travel?ref=e5s4bv">Looks like Moment is coming for Peak Design.</a> The product names are pointedly similar. I was briefly confused by the promo mail.</p>
<h2 id="because-you-can">Because you can</h2>
<p>I had an item for today&rsquo;s post I decided wasn&rsquo;t quite ready. Using org-mode to blog, I would have done a quick <code>org-refile</code> to move the heading into a drafts section where I can work on it later. But I&rsquo;m writing in Markdown so that was off the table. I just made a file called <code>drafts.md</code> and committed it, then added the heading to it for later with good ol&rsquo; fashioned kill/yank.</p>
<p>But I did briefly think &ldquo;oh, see &hellip; good reason to go back to org-mode for blogging.&rdquo;</p>
<p>Except it&rsquo;s not. It&rsquo;s a terrible reason.  I just counted how many keystrokes it took me to collapse a heading, kill it, switch buffers, and yank it. It was &hellip; not a lot? 10? How about an org-refile operation? Yes. Fewer for sure. About half as many. The not-org-refile approach incurs some cognitive load, I suppose. When I was blogging in an org-file monolith my refile target was the only choice for that file. The Markdown version requires me to remember that I bookmarked my drafts.md file.</p>
<p>Probably seems like a weird thing to care about, but when I think about how ADHD shows up for me, it often takes the form of trying to do everything quickly to get on to the next thing. But I&rsquo;ve also got the hyperfocus thing going on, which finds a lot of expression in automation challenges I get lost in, trying to shave a few more seconds or keystrokes off a process.  When everything is wired up to drive down friction, I don&rsquo;t give myself time to think. I&rsquo;m just moving. I end up living in either a closed off, hyperfocused space where I&rsquo;m grinding out incremental improvements, or I&rsquo;m flying along the treetops.</p>
<p>It&rsquo;s about the thing I&rsquo;m doing with the Obsidian/Things division of labor. I wrote about this a few days ago when I mentioned the way I&rsquo;m <a href="/posts/2023-06-25-daily-notes/#mingling-notes-and-todos">blending todos into my note text</a>, but only long enough to leave a reminder to myself to go back and turn something into a real action in my system of record for todos. I think it&rsquo;s bad for me to have everything in the same system, because the less friction there is to record and remember, the more stuff just gets shoved into what eventually becomes an old shoebox full of receipts with purple crayon scribbles and grease stains.</p>
<p>Today, for instance, I had five meetings. Three of them produced things that I needed to remember to do later. I dropped todos into the text as I was taking notes. At the end of the day, I went to my <code>Today</code> page and looked at the Todo section, dynamically created from todos in any notes dated today.  A few were &ldquo;just do it now&rdquo; sorts of things that I knocked out before they could even hit Things. A few, it was helpful to jump back to the note to see things like &ldquo;why did he tell me to ping Felix?&rdquo; A few, it was helpful to write a more thoughtful plan in Things (and drop the Obsidian URL in to link back to the more complete notes).</p>
<p>There is some friction in that workflow. It does require a &ldquo;clear the decks&rdquo; item on my daily calendar at the end of the day so I can make sure to go back and consolidate. I feel a lot more composed and certain of the quality of the things I&rsquo;m actually putting into my todo system, though, when I have those liminal tasks to go back to, reconsider, and rewrite after revisiting their context.</p>
<p>This is not, I guess I should add, something unique to Obsidian. You could do this in any of the org-mode using tools, or any plaintext system where there&rsquo;s an easy way to create TODOs and find them later. Obsidian&rsquo;s dataviews and Tasks plugin makes it easy. org-mode similarly can do it with agenda views, Denote dynamic blocks, etc. The value is in slowing down, stopping the high-speed accumulation of <em>stuff</em> that&rsquo;s stripped of context and crammed into a digital shoebox, and providing pointers back to useful context for when the time comes to turn a quickly jotted todo into a meaningful action.</p>
<p>You don&rsquo;t even, I suppose, have to spread it out over multiple apps. But I do find that the act of putting Obsidian and Things side-by side and having to transpose prose to lists is a useful exercise. It&rsquo;s a bit of deliberation and rethinking that&rsquo;s clarifying.</p>
<h2 id="comments">Comments</h2>
<p>&hellip; I&rsquo;d love to add &rsquo;em, and I was looking at some recipes for doing it using Mastodon, but half the examples led to 404s, one of them swore to god it was working then said it wasn&rsquo;t and then said it was, and was also leading to 404s. Not enough time in the day. The ones that did work had a very awkward, high-friction energy to them.</p>
<p>Given that I push posts out over one channel, and that almost all my inbound traffic is coming in from Mastodon people, I&rsquo;d be happy for just the part where you can visit an announcement post. But that part seems to be harder than it needs to be given the federation stuff.</p>
<p>Not enough time in the day to worry about this stuff. Definitely do not want to pay anyone. Definitely not interested in sticking Disqus in there. Think I&rsquo;ll table it.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Daily Notes for 2023-05-19</title>
      <link>https://mike.puddingtime.org/posts/2023-05-19-daily-notes/</link>
      <pubDate>Fri, 19 May 2023 00:00:00 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2023-05-19-daily-notes/</guid>
      <description>Helping org-edna out when you&amp;rsquo;re using BeOrg and the limits of hyper-automated plaintext primitivism.</description>
      <content:encoded><![CDATA[<h2 id="using-beorg-with-org-gtd-org-edna">Using BeOrg with org-gtd/org-edna</h2>
<p>So, org-gtd makes heavy use of org-edna:</p>
<p>When you&rsquo;re working down a project&rsquo;s todos, each time one flips to <code>DONE</code> it triggers org-edna to move the next task into a <code>NEXT</code> state. So far so good and awesome if you&rsquo;re just using Emacs.</p>
<p>If you&rsquo;re out and about with your iPhone (or Orgzly, or whatever) and do not have a full Emacs environment, any state changes to a todo item won&rsquo;t have org-edna there to monitor and make the needed state changes for the next item.</p>
<p>Today, for instance, I am going to be out and about running a few errands that include picking some things up that I need to complete a few projects. I have a custom view set up in BeOrg to show me my <code>@errands</code> items in <code>NEXT</code> state. When I stop by the motorcycle shop to pick up a battery for my Grom, I&rsquo;ll want to tick that errand off as <code>DONE</code>. Because org-edna isn&rsquo;t there, the next item in the &ldquo;Get the Grom ready for summer&rdquo; project won&rsquo;t flip into a <code>NEXT</code> state, and org-gtd&rsquo;s handy &ldquo;next actions&rdquo; agenda list will lose track of the project (unless I explicitly check for stuck projects &ndash; projects with no item in a <code>NEXT</code> state.)</p>
<p><a href="https://appsonthemove.freshdesk.com/support/discussions/topics/14000019608?page=1">David Masterson on the BeOrg user forum</a> was grappling with the same problem and suggested a pretty good idea: Adding a transitional TODO state to BeOrg that you&rsquo;d then manually flip to <code>DONE</code> once sitting in front of Emacs on a real computer. That&rsquo;d then trigger org-edna and your list automation would be back on track. He proposed <code>PRE-DONE</code>, I just went with <code>BEDONE</code>:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span class="line"><span class="cl"><span class="p">(</span><span class="nb">defun</span> <span class="nv">mph/org-change-bedone-to-done</span> <span class="p">()</span>
</span></span><span class="line"><span class="cl">  <span class="s">&#34;Change all &#39;BEDONE&#39; states to &#39;DONE&#39; in current buffer.&#34;</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="nb">interactive</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="nb">save-excursion</span>
</span></span><span class="line"><span class="cl">    <span class="p">(</span><span class="nf">goto-char</span> <span class="p">(</span><span class="nf">point-min</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">    <span class="p">(</span><span class="nb">while</span> <span class="p">(</span><span class="nf">re-search-forward</span> <span class="nv">org-heading-regexp</span> <span class="no">nil</span> <span class="no">t</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">      <span class="p">(</span><span class="nb">when</span> <span class="p">(</span><span class="nv">string=</span> <span class="p">(</span><span class="nv">org-get-todo-state</span><span class="p">)</span> <span class="s">&#34;BEDONE&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">        <span class="p">(</span><span class="nv">org-todo</span> <span class="s">&#34;DONE&#34;</span><span class="p">)))))</span></span></span></code></pre></div>
<p>Then you&rsquo;d just want to automate <em>that</em>:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span class="line"><span class="cl"><span class="p">(</span><span class="nv">add-hook</span> <span class="ss">&#39;org-mode-hook</span> <span class="ss">&#39;mph/org-change-bedone-to-done</span><span class="p">)</span></span></span></code></pre></div>
<p>The two additional bits of setup: Adding &ldquo;BEDONE&rdquo; to BeOrg&rsquo;s list of todo states, and making sure it is also in the TODO state list in  your Emacs config, or in the file you&rsquo;re going to operate on. If you just try to use &ldquo;BEDONE&rdquo; instead of &ldquo;DONE&rdquo; without blessing it as an actual TODO state, the function will treat it like arbitrary text and ignore it.</p>
<p>My Grom example is pretty simplistic: I&rsquo;m not going to forget I am trying to get the Grom ready for summer, and will eventually go looking for the rest of the project if I accidentally move it into a stuck, next-actionless state.  But the whole point of org-gtd &ndash; GTD generally &ndash; is that you want to remove as much &ldquo;holding stuff in your head&rdquo; as possible.</p>
<h2 id="the-limits-of-hyper-automated-plaintext-primtivism">The limits of hyper-automated plaintext primtivism</h2>
<p>For the record, yes, this is pushing things. All sorts of things. The limits of hyper-automated plaintext primitivism. The willful naivete of GTD as a method. My own laziness, because the other option is to just write this stuff down and stick it in my pocket on the way out the door, or to not use BeOrg interactively if I&rsquo;m going to have a bunch of desktop-only automation.</p>
<p>The only real defense I have right now is, &ldquo;it&rsquo;s fun.&rdquo;</p>
<p>The only way to keep having this kind of fun will eventually be to either become a primitivist hyper-automation plaintext fetishism influencer with no need to do things like &ldquo;direct corporate IT operations&rdquo; or &ldquo;lead product engineering groups;&rdquo; or to crowd out other things in my life that matter much, much more than relieving myself of the drudgery of manually changing TODO states in a plaintext file.</p>
<p>A friend asked, &ldquo;are you ready to go back?&rdquo;</p>
<p>Yeah &hellip; seven months in, three of which were very deliberate rest, the rest of which have involved a state of relaxed calm but the stochastic cadence of screenings, interviews, and panels &hellip; I am ready: Rested, as clear on my purpose in the workplace as I have been in a long time, and as clear on what I am getting for my time as I have ever been. Uncle Tupelo for the rest.</p>
<div style="text-align:center;">
<iframe width="560" height="315" src="https://www.youtube.com/embed/wQ9TxwlRoEU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</div>
]]></content:encoded>
    </item>
    <item>
      <title>Were you to attempt something like this in AppleScript</title>
      <link>https://mike.puddingtime.org/posts/2023-04-27-were-you-to-attempt-this-with-applescript/</link>
      <pubDate>Thu, 27 Apr 2023 00:00:00 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2023-04-27-were-you-to-attempt-this-with-applescript/</guid>
      <description>&lt;p&gt;I started down the path of &lt;a href=&#34;https://mike.puddingtime.org/posts/20230413-making-a-plaintext-personal-crm-with-org-contacts/&#34;&gt;building some sort of PRM in org-mode&lt;/a&gt; because I couldn&amp;rsquo;t find anything that worked the way I wanted. I did briefly look at Apple&amp;rsquo;s Contacts app, and also at &lt;a href=&#34;https://flexibits.com/cardhop&#34;&gt;Cardhop&lt;/a&gt;, which builds on top of your Contacts database but still makes some assumptions about how good you are at all at remembering to reach out to people.&lt;/p&gt;
&lt;p&gt;I also looked at &lt;a href=&#34;https://monicahq.com&#34;&gt;Monica&lt;/a&gt;, an open source PRM. The promising part of Monica is its API. The web UI itself shows comprehensive data for each contact, but does not do anything in the way of bulk editing and has no automation at all. It&amp;rsquo;s laborious to bootstrap.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>I started down the path of <a href="https://mike.puddingtime.org/posts/20230413-making-a-plaintext-personal-crm-with-org-contacts/">building some sort of PRM in org-mode</a> because I couldn&rsquo;t find anything that worked the way I wanted. I did briefly look at Apple&rsquo;s Contacts app, and also at <a href="https://flexibits.com/cardhop">Cardhop</a>, which builds on top of your Contacts database but still makes some assumptions about how good you are at all at remembering to reach out to people.</p>
<p>I also looked at <a href="https://monicahq.com">Monica</a>, an open source PRM. The promising part of Monica is its API. The web UI itself shows comprehensive data for each contact, but does not do anything in the way of bulk editing and has no automation at all. It&rsquo;s laborious to bootstrap.</p>
<p>In the process of trying to figure out how I could write some automation to move Contacts information beyond the basic vCard fields into Monica I did end up having to learn about how macOS Contacts work and realized you can create custom labels for date fields then add them to your card editing template in Contacts&rsquo; preferences.</p>
<p>The data entry widget for these fields expects a date and is tolerant of not entering a year (which helps it support, er, &ldquo;polite&rdquo; birthdays). You can, in turn, use it somewhat opaquely in a Contacts smart list: There&rsquo;s a generic &ldquo;Date&rdquo; field you can filter on that looks at date fields in the card.  Paired with a &ldquo;within/not within,&rdquo; or &ldquo;in the next&rdquo; parameter, you can make a smart list of &ldquo;people not contacted in the past 30 days,&rdquo; etc.</p>
<p>If Contacts smart lists could also use groups, you could do a lot by just setting a &ldquo;last contacted&rdquo; date field and making a set of smart lists based on group membership. Contacts smart lists <em>can&rsquo;t</em> use groups, though, which is a strange oversight.</p>
<p>As I was trying to figure out, though, how to get my contacts uploaded to Monica in a way that would let me use its API to add tags to them once they were imported, I worked out some AppleScript that let me prepend a contact&rsquo;s group into its note as a hashtag. Contacts smart lists <em>can</em> filter on the contents of notes.</p>
<p>As a solution goes, it&rsquo;s in the category of &ldquo;cheap and cheerful.&rdquo; If you wanted to use macOS Contacts to keep track of your most recent touchpoint with someone, and drive a little automation to surface contacts you haven&rsquo;t reached out to in a while, you could do it with one custom field and adopting a simple convention for notes. You&rsquo;re also well into the territory of things AppleScript can do to help out, too: It is trivial to write scripts that automate logging, etc. or even write reminders or make events in a contacts calendar. In fact, here&rsquo;s a script that operates on the selected contact and lets you log activity in its note:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-applescript" data-lang="applescript"><span class="line"><span class="cl"><span class="k">set</span> <span class="nv">theDate</span> <span class="k">to</span> <span class="nb">current date</span>
</span></span><span class="line"><span class="cl"><span class="k">set</span> <span class="nv">noteDate</span> <span class="k">to</span> <span class="nb">do shell script</span> <span class="s2">&#34;date &#39;+%Y-%m-%d&#39;&#34;</span>
</span></span><span class="line"><span class="cl"><span class="k">tell</span> <span class="nb">application</span> <span class="s2">&#34;Contacts&#34;</span>
</span></span><span class="line"><span class="cl">	<span class="k">set</span> <span class="nv">selectedPeople</span> <span class="k">to</span> <span class="nv">selection</span>
</span></span><span class="line"><span class="cl">	<span class="k">repeat</span> <span class="k">with</span> <span class="nv">thePerson</span> <span class="k">in</span> <span class="nv">selectedPeople</span>
</span></span><span class="line"><span class="cl">		<span class="k">set</span> <span class="nv">customDates</span> <span class="k">to</span> <span class="nv">custom</span> <span class="nv">dates</span> <span class="k">of</span> <span class="nv">thePerson</span>
</span></span><span class="line"><span class="cl">		<span class="k">set</span> <span class="nv">lastContactedExists</span> <span class="k">to</span> <span class="no">false</span>
</span></span><span class="line"><span class="cl">		<span class="k">repeat</span> <span class="k">with</span> <span class="nv">aCustomDate</span> <span class="k">in</span> <span class="nv">customDates</span>
</span></span><span class="line"><span class="cl">			<span class="k">if</span> <span class="na">label</span> <span class="k">of</span> <span class="nv">aCustomDate</span> <span class="ow">is</span> <span class="s2">&#34;last contacted&#34;</span> <span class="k">then</span>
</span></span><span class="line"><span class="cl">				<span class="k">set</span> <span class="nv">value</span> <span class="k">of</span> <span class="nv">aCustomDate</span> <span class="k">to</span> <span class="nv">theDate</span>
</span></span><span class="line"><span class="cl">				<span class="k">set</span> <span class="nv">lastContactedExists</span> <span class="k">to</span> <span class="no">true</span>
</span></span><span class="line"><span class="cl">			<span class="k">end</span> <span class="k">if</span>
</span></span><span class="line"><span class="cl">		<span class="k">end</span> <span class="k">repeat</span>
</span></span><span class="line"><span class="cl">		<span class="k">if</span> <span class="ow">not</span> <span class="nv">lastContactedExists</span> <span class="k">then</span>
</span></span><span class="line"><span class="cl">			<span class="k">if</span> <span class="nv">length</span> <span class="k">of</span> <span class="nv">customDates</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="k">then</span>
</span></span><span class="line"><span class="cl">				<span class="k">set</span> <span class="nv">firstCustomDate</span> <span class="k">to</span> <span class="nb">first</span> <span class="nb">item</span> <span class="k">of</span> <span class="nv">customDates</span>
</span></span><span class="line"><span class="cl">				<span class="k">set</span> <span class="nv">newCustomDate</span> <span class="k">to</span> <span class="nb">make</span> <span class="nb">new</span> <span class="nv">custom</span> <span class="nv">date</span> <span class="nb">at</span> <span class="nb">after</span> <span class="nv">firstCustomDate</span>
</span></span><span class="line"><span class="cl">			<span class="k">else</span>
</span></span><span class="line"><span class="cl">				<span class="nb">make</span> <span class="nb">new</span> <span class="nv">custom</span> <span class="nv">date</span> <span class="nb">at</span> <span class="k">end</span> <span class="k">of</span> <span class="nv">custom</span> <span class="nv">dates</span> <span class="k">of</span> <span class="nv">thePerson</span> <span class="k">with</span> <span class="na">properties</span> <span class="p">{</span><span class="na">label</span><span class="p">:</span><span class="s2">&#34;last contacted&#34;</span><span class="p">,</span> <span class="nv">value</span><span class="p">:</span><span class="nv">theDate</span><span class="p">}</span>
</span></span><span class="line"><span class="cl">			<span class="k">end</span> <span class="k">if</span>
</span></span><span class="line"><span class="cl">		<span class="k">end</span> <span class="k">if</span>
</span></span><span class="line"><span class="cl">		<span class="k">set</span> <span class="nv">theNote</span> <span class="k">to</span> <span class="nv">note</span> <span class="k">of</span> <span class="nv">thePerson</span> <span class="k">as </span><span class="nc">string</span>
</span></span><span class="line"><span class="cl">		<span class="k">if</span> <span class="nv">theNote</span> <span class="ow">is</span> <span class="s2">&#34;missing value&#34;</span> <span class="k">then</span> <span class="k">set</span> <span class="nv">theNote</span> <span class="k">to</span> <span class="s2">&#34;&#34;</span>
</span></span><span class="line"><span class="cl">		<span class="k">set</span> <span class="nv">prependText</span> <span class="k">to</span> <span class="na">text returned</span> <span class="k">of</span> <span class="p">(</span><span class="nb">display dialog</span> <span class="s2">&#34;Enter text to prepend to the note of &#34;</span> <span class="o">&amp;</span> <span class="na">name</span> <span class="k">of</span> <span class="nv">thePerson</span> <span class="o">&amp;</span> <span class="s2">&#34;:&#34;</span> <span class="nv">default</span> <span class="nv">answer</span> <span class="s2">&#34;&#34;</span> <span class="nb">buttons</span> <span class="p">{</span><span class="s2">&#34;Cancel&#34;</span><span class="p">,</span> <span class="s2">&#34;OK&#34;</span><span class="p">}</span> <span class="nv">default</span> <span class="nb">button</span> <span class="s2">&#34;OK&#34;</span> <span class="nv">cancel</span> <span class="nb">button</span> <span class="s2">&#34;Cancel&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">		<span class="k">set</span> <span class="nv">noteUpdated</span> <span class="k">to</span> <span class="s2">&#34;[&#34;</span> <span class="o">&amp;</span> <span class="nv">noteDate</span> <span class="o">&amp;</span> <span class="s2">&#34;] &#34;</span> <span class="o">&amp;</span> <span class="nv">prependText</span>
</span></span><span class="line"><span class="cl">		<span class="k">if</span> <span class="nv">theNote</span> <span class="ow">is not</span> <span class="s2">&#34;&#34;</span> <span class="k">then</span> <span class="k">set</span> <span class="nv">noteUpdated</span> <span class="k">to</span> <span class="nv">noteUpdated</span> <span class="o">&amp;</span> <span class="no">return</span> <span class="o">&amp;</span> <span class="nv">theNote</span> <span class="o">&amp;</span> <span class="no">return</span> <span class="o">&amp;</span> <span class="s2">&#34; &#34;</span> <span class="o">&amp;</span> <span class="no">return</span>
</span></span><span class="line"><span class="cl">		<span class="k">set</span> <span class="nv">note</span> <span class="k">of</span> <span class="nv">thePerson</span> <span class="k">to</span> <span class="nv">noteUpdated</span>
</span></span><span class="line"><span class="cl">		<span class="nv">save</span> <span class="nv">thePerson</span>
</span></span><span class="line"><span class="cl">	<span class="k">end</span> <span class="k">repeat</span>
</span></span><span class="line"><span class="cl"><span class="k">end</span> <span class="k">tell</span></span></span></code></pre></div>
<p>So, looking at that, would you <em>want</em> to glue all this together with Applescript?</p>
<p>I don&rsquo;t think so. I don&rsquo;t, anyhow. It just took me a morning to figure that out.</p>
<p>In the process of roughing out automation for creating reminders, for instance, I managed to get Reminders.app to beachball on every run with a simple five-liner. Why? I don&rsquo;t know. Stack Overflow didn&rsquo;t know. But after a good 15 years of using AppleScript for jobs large and small, I know that sometimes you find its weird little corner cases and that&rsquo;s all there is to it. I&rsquo;d rather <a href="https://www.jwz.org/blog/2003/05/no-good-deed-goes-unpunished/">tell Jamie Zawinski that I don&rsquo;t know who the author of XScreensaver is</a> than ask Apple to fix it.</p>
<p>When I ask myself &ldquo;would I want to build something on top of this ecosystem that I mean to use forever?&rdquo; I can&rsquo;t even figure out three scripts I would need to write then get to the end of debugging the second one before I know the answer is &ldquo;no.&rdquo;</p>
<p>I mean, what does <em>forever</em> mean? Because my personal belief is that we have to assess the foreverness of the competing candidates, and probably think about how amenable data kept in the least forever of those formats is to being migrated to a more forever format/system:</p>
<ul>
<li>macOS Contacts</li>
<li>org-mode</li>
<li>vCard</li>
<li>plain text with moderately elaborate markup amenable to some automated processing</li>
</ul>
<p>(I put that list in ascending order of longevity/permanence, feeling very appreciative that org-mode allowed me to reorder it with <code>opt arrow</code>).</p>
<p>I trust macOS Contacts a bit. I don&rsquo;t how much money I would be willing to risk on a series of bets about it working as it does today in 2, 5, or 10 years. While trying to understand my AppleScript options with it I was brought face-to-face with changes to the underlying scripting model several times. In all fairness, those changes played out over decades and it&rsquo;s only because I&rsquo;m at a point in life where I can still think &ldquo;OS X is new&rdquo; that they even seem mentionable. It&rsquo;s also completely possible to get Contacts info out into some other format. There&rsquo;s also just the whole &ldquo;ramming your head against AppleScript&rdquo; aspect of the problem.</p>
<p>Moving up the Pyramid of Forever, I trust org-mode to be around for a very long time, but can also see how the API is still subject to change. Functions come and go so automation can break and make it hard to keep a contacts list maintained. On the other hand, I&rsquo;m not doing much now that couldn&rsquo;t be done by hand until I figured it out, and the things I&rsquo;ve bumped into are pretty small so far: changes in the namespace, functional replacements, etc.</p>
<p>Moving on:</p>
<p>I trust the vCard standard to stay how it is a bit more. It&rsquo;s on &hellip; version 3 or 4? &hellip; of the spec? There&rsquo;s a spec. There are a lot of stakeholders interested in that spec. Even Apple quietly crams a whole vCard property into each contact, even if it has its own version of each property you&rsquo;d find in a vCard anyhow.</p>
<p>So, moving on to the top of the pyramid:</p>
<p>I trust structured plain text to be useful for the rest of my life.</p>
<p>So something built on org-mode seems like the smart play for data longevity? Even if all my automation broke, core org-mode makes it easy to do the things I do: change todo states, add values to the <code>PROPERTIES</code> drawer, add tags, log changes, etc.</p>
<p>The one thing that I&rsquo;ve <em>mostly</em> decided not to worry about is the disconnect between my contacts list and my org-contacts file.</p>
<p>One useful feature of contacts via Fastmail is the dynamic &ldquo;Autosaved&rdquo; group. If I write someone, they go into that group. Periodically moving contacts that surface there into one of my permanent groups then removing them from &ldquo;Autosaved&rdquo; provides a simple, organic workflow for keeping up with new people. There is also a bunch of useful automation present in macOS/iOS for surfacing things about contacts from other apps, so you&rsquo;re constantly being offered the opportunity to pull in new information. This morning, for instance, going through my Contacts list, I noticed that something somewhere in the bowels of macOS or iOS was beginning to notice connections between my contacts and Ivory, the Mastodon client. That&rsquo;s pretty cool.</p>
<p>On the other hand, <em>this</em> is well within AppleScript&rsquo;s wheelhouse:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-applescript" data-lang="applescript"><span class="line"><span class="cl"><span class="k">tell</span> <span class="nb">application</span> <span class="s2">&#34;Contacts&#34;</span>
</span></span><span class="line"><span class="cl">	<span class="k">set</span> <span class="nv">selectedContacts</span> <span class="k">to</span> <span class="nv">selection</span>
</span></span><span class="line"><span class="cl">	<span class="k">if</span> <span class="nv">length</span> <span class="k">of</span> <span class="nv">selectedContacts</span> <span class="ow">is not</span> <span class="mi">1</span> <span class="k">then</span>
</span></span><span class="line"><span class="cl">		<span class="nb">display alert</span> <span class="s2">&#34;Please select exactly one contact.&#34;</span>
</span></span><span class="line"><span class="cl">		<span class="no">return</span>
</span></span><span class="line"><span class="cl">	<span class="k">end</span> <span class="k">if</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">	<span class="k">set</span> <span class="nv">theContact</span> <span class="k">to</span> <span class="nb">first</span> <span class="nb">item</span> <span class="k">of</span> <span class="nv">selectedContacts</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">	<span class="k">set</span> <span class="nv">theName</span> <span class="k">to</span> <span class="na">name</span> <span class="k">of</span> <span class="nv">theContact</span> <span class="k">as </span><span class="nc">text</span>
</span></span><span class="line"><span class="cl">	<span class="k">set</span> <span class="nv">theEmails</span> <span class="k">to</span> <span class="nv">value</span> <span class="k">of</span> <span class="nv">emails</span> <span class="k">of</span> <span class="nv">theContact</span> <span class="k">as </span><span class="nc">text</span>
</span></span><span class="line"><span class="cl">	<span class="k">set</span> <span class="nv">thePhones</span> <span class="k">to</span> <span class="nv">value</span> <span class="k">of</span> <span class="nv">phones</span> <span class="k">of</span> <span class="nv">theContact</span> <span class="k">as </span><span class="nc">text</span>
</span></span><span class="line"><span class="cl">	<span class="k">set</span> <span class="nv">theNote</span> <span class="k">to</span> <span class="nv">note</span> <span class="k">of</span> <span class="nv">theContact</span> <span class="k">as </span><span class="nc">text</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">	<span class="c">-- Format the contact data as an org contacts string</span>
</span></span><span class="line"><span class="cl">	<span class="k">set</span> <span class="nv">theContactString</span> <span class="k">to</span> <span class="s2">&#34;** &#34;</span> <span class="o">&amp;</span> <span class="nv">theName</span> <span class="o">&amp;</span> <span class="s2">&#34;
</span></span></span><span class="line"><span class="cl"><span class="s2">:PROPERTIES:
</span></span></span><span class="line"><span class="cl"><span class="s2">:EMAIL: &#34;</span> <span class="o">&amp;</span> <span class="nv">theEmails</span> <span class="o">&amp;</span> <span class="s2">&#34;
</span></span></span><span class="line"><span class="cl"><span class="s2">:PHONE: &#34;</span> <span class="o">&amp;</span> <span class="nv">thePhones</span> <span class="o">&amp;</span> <span class="s2">&#34;
</span></span></span><span class="line"><span class="cl"><span class="s2">:NOTE: &#34;</span> <span class="o">&amp;</span> <span class="nv">theNote</span> <span class="o">&amp;</span> <span class="s2">&#34;
</span></span></span><span class="line"><span class="cl"><span class="s2">:NAME: &#34;</span> <span class="o">&amp;</span> <span class="nv">theName</span> <span class="o">&amp;</span> <span class="s2">&#34;
</span></span></span><span class="line"><span class="cl"><span class="s2">:END:&#34;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">	<span class="c">-- Copy the contact string to the clipboard</span>
</span></span><span class="line"><span class="cl">	<span class="nb">set the clipboard to</span> <span class="nv">theContactString</span>
</span></span><span class="line"><span class="cl"><span class="k">end</span> <span class="k">tell</span></span></span></code></pre></div>
<p>&ldquo;Look through new contacts, run that script from a keyboard shortcut, paste the new contact into my <code>contacts.org</code> file.&rdquo;</p>
<p>I could go one step further and <em>append</em> the text to my <code>contacts.org</code> file, but I don&rsquo;t like operating on busy files like that.</p>
<p>AppleScript was plainly built to do little things like that. You have to learn its sort of crabbed, verbose way of doing things, but it&rsquo;s not too hard (and Shortcuts is getting pretty good if you can deal with the sudden drop in functionality that can appear out of nowhere when you hit the limits of some Apple engineer&rsquo;s imagination or time).</p>
<p>Anyhow, it all just comes down to aesthetics and preferences, right?</p>
<p>I&rsquo;ve got a draft heading sitting in my blog.org file with a title of &ldquo;Plain text is calming.&rdquo; I&rsquo;m not sure where that little essay is going, but I know where it started: When I&rsquo;m staring at a text editor I feel much better than when I&rsquo;m staring at a web or app UI. I might have some challenges with discoverability, or a lack of forgiveness for little slips of the finger, or whatever. But I still feel better because I&rsquo;ve been a happy citizen of Plaintext Land for over 30 years, and there is a governing mentality there that does not exist in other parts of the technology world. I&rsquo;m not saying the <a href="https://www.puppet.com/docs/puppet/8/http_api/pson.html">occasional wheel doesn&rsquo;t get reinvented,</a> but I am saying that with most plaintext stuff you get to choose your tools, or make them for yourself if there are no good choices. So it&rsquo;s calming because I don&rsquo;t have that feeling of always looking for the exit when I encounter a plaintext system. I know it&rsquo;s there.  That&rsquo;s the preference, anyhow. I made money for a few years being really, really good at turning CMS databases into plaintext and massaging them into other CMSes, so my patience for finding the structure and working with it is high. I don&rsquo;t worry about where the exit is because in my 40-year history with computers, it has never eluded me in the plaintext world.</p>
<p>The aesthetics are another kettle of fish, and plaintext people run a weird gamut from &ldquo;text editors are like samurai swords&rdquo; to &ldquo;mastery of a plaintext interface is a kind of performance art.&rdquo; Right now I&rsquo;m sort of luxuriating in Evil mode, because I finally get the emphasis on ruthless elimination of motion vi engenders. I&rsquo;ve  <a href="/img/Joy04.pdf">made terrible fun of people over this in the distant past</a> and feel a little bad about that, but less than two months into this particular experiment, I don&rsquo;t want to go back. Evil mode is like the end of the first Star Trek movie as far as I&rsquo;m concerned.</p>
<figure><img src="/img/decker_ilia.gif"
    alt="Will Decker and Ilia merging into some sort of computer overmind in Star Trek: TMP">
</figure>

<p>Anyhow, I do want to get back to the whole &ldquo;plaintext is calming&rdquo; idea and do some more writing about it. Today&rsquo;s jaunt into &ldquo;what if I could make what I wanted in the macOS ecosystem?&rdquo; was one of those processes I go through when I&rsquo;ve gone so far with an idea and wonder if I really want to commit &ndash; if I&rsquo;m not making life a little harder on myself than I need to, or if there&rsquo;s not some simpler way to do it (even if still in the DIY mode,) and the answer came back &ldquo;don&rsquo;t think there is.&rdquo; I&rsquo;m at home in what I made.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
