an icon of a terminal window and a red heart that looks like it's beating

Automation Gives Me All the Feels

When Bart and I hatched our plan for him to teach me and the audience how to program, he called it Programming By Stealth for a very specific reason. His plan was to sneak up on us by teaching us a single language first and then when we weren’t noticing, keep adding to our toolkit until we turned around one day and realized that we were developers. He started with simple HTML to create web pages, then some CSS to style our web pages. But what fun is a web page without some JavaScript to make it do things?

Over the years, Bart has continued to build on the lessons learned from before while introducing new concepts and new languages to us. He isn’t teaching us languages, he’s teaching us how to think like developers. He’s teaching us that powerful tools are within our reach. He’s teaching us how to learn.

Long before Programming By Stealth was a twinkle in our eyes, I remember people raving about how fun it was to automate things. I wanted to be one of the cool kids who did that, but for the life of me I couldn’t think of anything I needed automated. Now I feel like everywhere I look there’s some tedious task to be eliminated and improved. It’s like I got a pair of glasses that let me see what was there all along.

While I’ve accomplished some complicated things that make me quite proud, sometimes it’s the little things that just make me feel all warm and fuzzy. Let me give you a tiny but lovely example.

ScreenCastsONLINE File Names

Creating video tutorials for ScreenCastsONLINE is a lot of work, and the software we use to record, edit, and produce the videos, ScreenFlow, is a bit twitchy and unreliable. To combat the fear of losing all my work, I store my ScreenFlow file locally, and every time I finish a chunk of work on it, I copy that file to a folder in Dropbox.

Since I’m creating multiple files of the same name, I need to differentiate them. For a long time, I manually appended the date and time to the end of the file name. For example, let’s say I’m working on a tutorial for Audacity, and I make a copy of the file at 4:55 PM on March 15th, so I would change the name to “Audacity 2025-03-15 1655.screenflow”.

A few years ago, as my automation chops were heating up, I decided to automate it a bit by using a TextExpander snippet. In TextExpander, there’s a little calendar icon and a clock icon. Each of those will place little tokens that will automatically insert the date and time. Under the calendar, you can drop in the year in YYYY format, then another one for the month as MM, and the day as DD. I chose to put dashes between them to make it look nice. The clock does the same kind of thing with hour, minute, and second. My saves are far enough apart that the seconds aren’t important so my appended text just ends with HHMM.

TextExpander snippet for date time append to SCO videos.
TextExpander Snippet to Add Date/Time

With this fancy TextExpander snippet, I could make a copy of the Audacity file in Dropbox, hit enter to select the text of the file name, ⌘-right arrow to get to the end of the name, hit the space bar, and then type my TextExpander abbreviation to append the date and time. I was quite pleased with my new automation.

I went along happily with that solution for years, but just last week I started wondering if there was a way to do it even more automatically. Hazel from Noodlesoft is a fantastic app whose job is to watch folders and then take action on files when they arrive in those folders. I’ve been automating things with Hazel for ages, but for some reason it hadn’t occurred to me to use it for this automation. Something about the way Bart has been layering tool after tool on the Programming By Stealth audience just starts your brain working differently.

Hazel has a couple of ways I could automate my appended date and time to my copied ScreenFlow files. For both methods, you start by telling Hazel which folder to watch. Then you add rules to the folder and name them. I called my rule “Add Date.” I know, I’m inventive that way.

Next, you tell Hazel the conditions under which it should apply the rule. For this tutorial, my main file will simply be called Audacity.screenflow, so my condition is simply that it only apply the rule to files of that exact name. I can’t have it look generically for any files ending in .screenflow because the copies that are renamed with the date will also end in .screenflow. Hazel would just keep appending the date and time indefinitely to all files. I’ll have to change this condition for the next tutorial I create, and perhaps there’s a way to automate even that step but changing it once for a two-week project isn’t onerous.

Now that we’ve taught Hazel how to recognize the file to rename, we need to tell Hazel how to append the date and time under the heading “Do the following to the matched file or folder”. Hazel has built-in tokens for just this purpose. There’s a dropdown I changed to Rename, and then it offers “with pattern”. To the right, it automatically drops in two tokens: “name” and “extension”. With that default, it would rename it with the same name and extension.

Hazel interface to add date tokens.
Hazel Interface to Add Date/Time Tokens

Clicking into this area pops up a window where you can add all kinds of other tokens. For my needs, I want the “date added” token, and from there, I can use the “edit pattern” option on the token to define exactly how I want the date and time to look. It’s really quite easy.

Now I’m going to make a confession. I didn’t use the easy drag-and-drop interface of Hazel with its little tokens. I was busy working on my video tutorial, so I outsourced the solution to my assistant, Claude.ai. Claude suggested I use Hazel’s ability to run a script instead, and offered an AppleScript to perform the same function.

I’ve had experience with AppleScript to understand what Claude wrote for me, so I felt confident that it wasn’t going to do any damage if it made a mistake. Claude adds comments for each function making it pretty easy to understand what it’s doing.

Hazel add date and time with applescript.
Hazel with AppleScript for Date/Time

I put the full text of the script into the shownotes if you’re interested.

# Get the directory and current name of the file
dir=$(dirname "$1")
current=$(basename "$1")

# Remove the extension to get just the name part
name_only=${current%.screenflow}

# Get the modification date/time of the file in the requested format
date_time=$(stat -f "%Sm" -t "%Y-%m-%d %H%M" "$1")

# Create the new name with date/time appended
new_name="${name_only} ${date_time}.screenflow"

# Move the file with the mv command to preserve the package
mv "$1" "$dir/$new_name"

I know this is an itty bitty automation created with a simple drag-and-drop interface (or a six-line AppleScript if you’re fancy), but every single time it renamed my file when I copied it into Dropbox, I smiled. You can’t buy that kind of joy.

Stream Deck for Audio Editing

Another fun automation I did recently involved using my Stream Deck for audio editing. I don’t do a lot of fancy stuff with my Stream Deck, but I have programmed a few buttons that I use all the time. My favorite is one to switch from headphones to speakers for audio playback.

I don’t do a lot of audio editing, partly because I find it dreadfully boring and time-consuming. If I’ve just done an hour-long interview with someone, the last thing I want to do is go back and listen to it again, but more slowly. The other reason I don’t do it is because most of my guests are clear and concise speakers who don’t fumble for words. Bart is a great example — off the cuff, he rarely makes any kind of mistake or an “um” or “uh”. If anyone makes “ums” and “uhs”, it’s usually me!

When I’m recording solo segments, I start and stop when I flub up and just delete the flub and jump back in. I find that much easier than trying to splice out mistakes.

But a while back, I had Pat Dengler on the show and afterward, she was kind of sad. She was disappointed in how many ums and uhs she did. I decided to make her happy and remove as many as I could from the recording.

In ScreenFlow, I have segments of me talking where it’s not practical to stop and edit along the way as I do for the podcast, so I do have to edit after the fact. Don McAllister wrote a series of Keyboard Maestro macros to give us keystrokes for editing. They’re simply marvelous. My favorite lets you select a region of the recording, and in one keystroke, it cuts, rewinds a smidge, and then plays. It’s so fast to know whether you’ve done a good cut or maybe cut a word off too soon.

When I started editing my recording with Pat using my audio software, Hindenburg, I really truly missed Don’s Keyboard Maestro macros. I’d drag across an “um” in the waveform with my cursor, move my hands to the keyboard, hit ⌘-X to cut the region, move my hand back to the trackpad, place the cursor where I wanted to start playing, move my hands back to the keyboard and hit the space bar to play. The tedium was overwhelming!

Bart has often talked about how the best programming is when you’re scratching your own itch. This one itched real bad! But he also has instilled in us the faith in ourselves that we can probably automate our way out of the annoyance we’re facing.

You’ve heard me refer to Hindenburg about 358 times over the past few years, but you’ll notice I’ve never explained much about how it works or recorded a tutorial for ScreenCastsONLINE about it. That’s because much of it is still mysterious to me, and I’ve never taken the time to buckle down and learn the whole darn thing! The good thing is I pointed Jill from the Northwoods to Hindenburg early on in her podcasting journey, and she watched all of their videos and read all of the manual, so when I get stuck I just ask her questions about Hindenburg!

My goal at this point was to replicate what I have over in ScreenFlow with Don’s Keyboard Maestro macro. I wanted a single action to cut, rewind, and play. Cut is easy, but that rewind and play part was going to take some sleuthing. While Hindenburg is a highly complex and capable tool, I find that much of its capability is hidden, so you have to know it’s there and know what it’s called in order to even search for it in the very annoying documentation.

While Preferences for Hindenburg are very meager, with only three tabs, on the middle tab called Interface, I found a setting labeled “Pre-roll time (ms),” and it was set to 3000. That kind of smelled like what I was looking for. A full 3 seconds of rewind is way more than I would want, so I set it to 1000 for 1 second. Ok, that’s great, but how do I make pre-roll go?

Hindenburg Preferences Interface tab showing preroll timing in ms.
ONLY Reference to Pre-Roll in Hindenburg Interface

I flipped through every single menu in the menu bar, and there was absolutely no mention of this mythical pre-roll. One of the reasons Hindenburg is so difficult to learn is that there is no user manual to speak of. Instead, they have video guides … with no words, just music playing while they show you something. I like a video tutorial as much as the next woman, but they’re really hard to search.

I eventually found the right video, and after all that searching for how to activate pre-roll, typed in text on top of the video it said “press P”. Geez, that could have been a menu bar item, couldn’t it?

Armed with how to cut with ⌘-X and how to pre-roll with P to hear the audio after the cut, I added a multi-action button to my Stream Deck. I named it Cut + Pre-roll because I’m inventive. I dragged in two system hotkeys, one for ⌘-X and one for P.

Stream Deck Multi-action for cut and pre-roll.
Stream Deck Multi-Action Button for Cut & Pre-Roll

I tested the button, and it worked perfectly to cut and pre-roll my audio. I was so enchanted with the new button that I made a single action button for play-pause, where the hotkey is just the spacebar. That might seem like a trivial button since the spacebar is pretty easy to use, but I found that I could do my editing with my left hand on the Stream Deck and my right hand on the trackpad doing the selecting. It was easier to use my left hand to play pause than to give my right hand two things to do.

I was so excited about this itty bitty little automation that I made a little video to show you.

Short Video of Stream Deck Automating Hindenburg Cut then Pre-roll

In the video, my button has a generic icon but I got frisky while writing up my joy about this automation and decided to make my own button. Stream Deck has a little web app to help you make them. I didn’t see anything that inspired me in the library of icons, so I used The Noun Project to find a nice icon of a pair of scissors and the letter P. I chose to make them red, plopped them into the web app, and made my little button icon.

Elgato button icon maker showing my icon and lots of fun ones.
Elgato Interface to Make Your Own Button Icons
Stream Deck showing scissors P for my multi action button.
Cute Icon for Cut Pre-Roll Action

DropShadow Example

Back in 2016, I wrote an article about how I wrote a little app for myself to add drop shadows to my images. If you look back on my posts from back then, the images look pretty fuzzy but they do have a nice drop shadow. Since then, Helma helped me add some CSS code (cascading style sheets) to my theme so that any image I upload has a drop shadow, and with MarsEdit, I can tell it to double the resolution so everything looks crisp.

I bring all this up because I got a comment on my article just a week or so ago from Scott asking for help getting my little DropShadow app to work. This required some real dusting off of the old brain cells as I reread my own post on how I created it.

There’s an open source library called ImageMagick that does most of the work on the command line, but I used Automator to package the ImageMagick script into an app. I explained how to build this yourself but also gave a download of my Automator app. Scott was getting an error when he ran the download and he posted the error.

If you ask me what I did last week, I pretty much can’t tell you, so the chance I’d be able to remember what I did 9 years ago was pretty slim. If it weren’t for Bart instilling this love of coding, that itch Scott put in my brain to figure it out would have gone unscratched.

Instead, I spent a short bit of time asking Claude what Scott’s error was trying to tell us, and a long bit of time writing an addendum to my article and enhancing the app quite a bit. The easy answer was that Scott hadn’t selected a file before asking the app to add the drop shadow.

The long answer is that it was never going to work under macOS Sequoia because of a permission dance he would need to do to use it. Oh, and if you’re on Apple silicon, my shell script inside Automator wouldn’t work either. I only knew that because I discovered a while back on another coding project that Homebrew moved where it installs apps with the switch to Apple silicon.

As I worked through writing up the addendum instructions, I was very frustrated that I hadn’t put a full screenshot of the Automator app into the shownotes so I was guessing at parts of it. Since 2016, I have discovered both Shottr and CleanShot X which will take scrolling screenshots, so I was able to add the entire Automator screenshot in all its glory to the addendum.

After I added the 2025 update to the article, I commented on the blog post to alert Scott that I’d answered his questions. And wouldn’t you know it — after thanking me, he asked for an enhancement to the app. Since he’d hit a brick wall when he tried double-clicking on the downloaded app, he asked whether I could make it politely ask for a file instead of throwing an incomprehensible error. You know I thought that sounded like fun, right?

I didn’t go as far as Scott asked (mostly because I got lazy) but I think I addressed the spirit of his request. Now if you double-click on the app, instead of throwing an incomprehensible error, it simply tells you to drag a file onto the app for it to add the drop shadow.

I had a lot of fun dusting off this 9-year-old project and it made me feel good that Scott was getting value out of it. If you’d like to try my little DropShadow app for yourself, you can download it with its README file at www.podfeet.com/…

Bottom Line

Now, back to the point of the story. Before Bart and I started Programming By Stealth in October of 2015, I was simply someone who wished they could think up something to automate. After nearly a decade of Bart giving us this slow and steady instruction in so many languages, tools, and concepts, everywhere I look, I see opportunities to automate. While I’m working on these automations, and when I succeed, I feel good. I feel accomplished. I feel powerful. I have all the feels.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top