<?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/automator/</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>Wed, 05 Sep 2012 03:55:42 +0000</lastBuildDate>
    <atom:link href="https://mike.puddingtime.org/tags/automator/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Use Automator to Append to an org-mode Inbox</title>
      <link>https://mike.puddingtime.org/posts/2012-09-05-use-automator-to-append-to-an-org-mode-inbox/</link>
      <pubDate>Wed, 05 Sep 2012 03:55:42 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2012-09-05-use-automator-to-append-to-an-org-mode-inbox/</guid>
      
      <description>I’m pretty sure there are some org-mode modules for skinning something like this cat, but I read a tip in MacWorld today about creating reminders outside of the Reminders app using Automator and it seemed like a thing to adapt to org-mode once I’d finished my sandwich.
So … you fire up Automator and …</description>
      <content:encoded><![CDATA[<p>I&rsquo;m pretty sure there are some org-mode modules for skinning something like this cat, but I read a tip in MacWorld today about <a href="http://www.macworld.com/article/1168410/create_reminders_when_you_arent_in_reminders.htmllsrc.rss_main">creating reminders outside of the Reminders app</a> using Automator and it seemed like a thing to adapt to org-mode once I&rsquo;d finished my sandwich.</p>
<p>So &hellip; you fire up Automator and tell it you&rsquo;re creating a new service, then:</p>
<ul>
<li>
<p>you tell it &ldquo;Service receives no input in any application&rdquo;</p>
</li>
<li>
<p>you tell it &ldquo;Ask for Text&rdquo; and add a useful format reminder, such as &ldquo;Add an item to the org-mode inbox (item |yyyy-mm-dd)&rdquo;</p>
</li>
<li>
<p>you tell it &ldquo;Run Shell Script,&rdquo; passing input <strong>to stdin</strong>.</p>
</li>
<li>
<p>you include this script, seasoned to taste where your own org-mode inbox is concerned:</p>
</li>
</ul>
<script src="https://gist.github.com/3626160.js?file=automator_org.rb"></script>
<p>Then you save it as a decent name you don&rsquo;t mind seeing in your services menu, visit the Services Preferences panel and assign it a shortcut you&rsquo;ll remember, and you get a quick dialog each time you hit the shortcut key that lets you add something to your org-mode inbox.</p>
<p>It&rsquo;s super-simple, and you need to remember to separate the todo with a pipe character (and never use a pipe character for the headline of your org-mode entry), then enter your todo date in the correct (yyyy-mm-dd) format. If you don&rsquo;t add a date, it won&rsquo;t try to, either.</p>
<p>If you&rsquo;d rather it use the selected text from your current application, you can always tweak the workflow so the service &ldquo;receives text&rdquo; from &ldquo;any application,&rdquo; which will prepopulate the popup form with your selection.</p>
<p>For grabbing links or selections out of a small set of Mac apps and getting them into org mode, there&rsquo;s always <a href="http://orgmode.org/worg/org-contrib/org-mac-link-grabber.html">org-mac-link-grabber</a> and there&rsquo;s also the handy <a href="http://orgmode.org/worg/org-contrib/org-mac-message.html">org-mac-message</a> for getting links to the current selected Mail.app message into org-mode. I put that there mainly to save you from doing what I once thought seemed perfectly sensible, which is jettisoning Mail.app for GNUS.</p>
<p>I guess neater still, were I a &ldquo;neater still&rdquo; sort of fellow, would be to grab the selected text of the current application, but offer the dialog, turning the selection into plain text under the new org-mode headline.</p>
<p>#automator #emacs #mac #org-mode</p>
<p><em><a href="mailto:mike@puddingtime.org?subject=Re%3A%20Use%20Automator%20to%20Append%20to%20an%20org-mode%20Inbox">Drop a line about this</a>.</em></p>]]></content:encoded>
    </item>
    <item>
      <title>Epochal Automator</title>
      <link>https://mike.puddingtime.org/posts/2012-06-01-epochal-automator/</link>
      <pubDate>Fri, 01 Jun 2012 07:24:17 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2012-06-01-epochal-automator/</guid>
      
      <description>When Drupal thinks of time, it thinks in Unix timestamps. That is good for computers, not so good for me when I&#39;m staring at a quick database query and just need to know when something happened, was saved, or will be updated next.
Several months back my friend Sam asked for a way to quickly convert …</description>
      <content:encoded><![CDATA[<p>When Drupal thinks of time, it thinks in Unix timestamps. That is good for computers, not so good for me when I'm staring at a quick database query and just need to know when something happened, was saved, or will be updated next.</p>
<p>Several months back my friend Sam asked for a way to quickly convert a UNIX timestamp to a human readable date. He had a snippet of Ruby he was using, so we worked out an Automator workflow to take the mouse selection and copy the converted date to the clipboard. I usually just want to see the date, not do anything with it, so here's a version that uses Growl to quickly display the converted date.  You need to have <a href="http://growl.info/">Growl</a> installed. I should also note that Growl provides Automator actions, but I couldn't get them to take input from the preceding Automator action. </p>
<p>1. Install the Ruby growl gem. This will give you the Growl command line app, too:</p>
<pre>sudo gem install ruby-growl</pre>
<p>2. Test that the command line app is working:</p>
<p><code>echo "Hello world" | growl -H localhost</code></p>
<p>3. Fire up Automator and tell it you're making a service:</p>
<div style="text-align: center; margin: 1em;">![](https://media.puddingtime.org/archive/mph.puddingbowl.org/wordpress/wp-content/uploads/2012/05/automator_service.jpg)</div>
<div style="text-align: left; margin: 1em;">4. Tell Automator your new service is receiving the selected text from any application:</div>
<div style="margin: 1em;">![](https://media.puddingtime.org/archive/mph.puddingbowl.org/wordpress/wp-content/uploads/2012/05/automator_input.jpg)</div>
<div style="margin: 1em;">5. Drag "run shell script" from the Utilities list into your workflow.</div>
<div style="margin: 1em;">6. Paste this into the shell script action you just dragged in:</div>
<div style="margin: 1em;">
<p><code>for f in "$@"<br />do<br />     date -r $f | growl -H localhost -t "Date from UNIX timestamp:"<br />done</code></p>
<p>7. Save it and remember its name. </p>
<p>8. Assign your new service a sensible keyboard shortcut:</p>
<p>8a. Open System Preferences -&gt; Keyboard and click the "Keyboard Shortcuts" tab</p>
<p>8b. Look for your service under "Text"</p>
<p>8c. Click the grayed-out word "none" next to your service, then click "add shortcut"</p>
<p>8d. Enter your shortcut</p>
<p>That's pretty much it. </p>
<p>There are a few more things you can do to customize it. In the Growl System Preferences, you can pick the style of alert for "ruby-growl," including whether or not it makes any sound and whether or not it's sticky. </p>
<p>Here's a sample:</p>
<p>![](https://media.puddingtime.org/archive/mph.puddingbowl.org/wordpress/wp-content/uploads/2012/05/growl-timestamp.jpg)</p>
</div>
<p>#automator #drupal #epoch #mac #timestamps #unix</p>
<p><em><a href="mailto:mike@puddingtime.org?subject=Re%3A%20Epochal%20Automator">Drop a line about this</a>.</em></p>]]></content:encoded>
    </item>
  </channel>
</rss>
