Ask HN: What do you automate in your workflow?

51 points by behnamoh ↗ HN
I'm curious what tasks people automate. I often write short scripts to do simple things like summoning Kitty by Ctrl-Space in quake mode (macOS, using Hammerspoon), changing the external monitor's brightness, switching audio output device, etc. On iPhone, I've created some complex iOS Shortcuts. One of them is basically an app at this point. I've also made a number of Word VBA macros that have really helped me with tedious tasks.

24 comments

[ 1.8 ms ] story [ 65.5 ms ] thread
Nothing special, so I am interested in seeing other answers.

Email addresses customized to the merchant/sender and lots of email filters to route incoming messages to folders.

What kind of word macros?

I've often thought that there's more value in extending office apps than is taken advantage of. It's an interesting case where it's difficult to make an extension that can do "anything", but relatively simple to make an extension that can do one simple task really, really well.

Like search and replace among equations, change font for all equations AFTER they're written, scroll up and down using Vim keys, etc.
batch files that I wish I was better with
If you like customizing and automating things then you should look at linux.

My entire environment was hand crafted from the ground up, so I guess “everything” is my response.

never heard of it
I know. The advantage of Linux is that you can pretty much write a script that sets up the exact same OS settings on new machines. Definitely useful for system admins.
You could probably do a lot of that for Windows or Mac with a provisioning tool like ansible as well.

It's definitely all powerful with Linux but people should definitely try anyway if it's valuable enough for them.

My time to shine.

I have built a programmable tooltip for Mac. It works on any app. I use this hundreds of times a day at work for 2y now.

You can select any text and activate the tooltip with the short key. Then, the tooltip offers a list of options like jumping to URL, showing some extra info.

You are the one who write the script to process the text and return the options.

You can check it out here: github.com/tanin47/tip

PS. I configure a mouse button to trigger the Tip short key, so it is even more convenient.

This is pretty interesting. When I was using Windows at work I made something like this with AutoHotKey. I’d highlight text, hit a button on my mouse, it would load that text into a GUI and give me a dozen options for what I wanted to do with it. Some options were basic, just appending it to a URL to do a search, while others were more involved, requiring some config setup in the GUI to open something in a native app. It was fantastic, and many people on my team started using it.

Since I moved to macOS at work all of that went away and I haven’t been able to find a good alternative to AutoHotKey for macOS. Although it’s hard to know if I can even attempt to run this at work with how locked down things have become.

> Although it’s hard to know if I can even attempt to run this at work with how locked down things have become.

If it helps, Tip runs in App Sandbox without requesting any additional permission.

This means Tip cannot read any file on your computer (other than the predefined places in its own sandbox) nor anything on other apps.

There are 2 limited things that it can do:

1. It can only execute the script that you provide at ~/Library/Application\ Scripts/tanin.tip/provider.script

2. It can only see the string that you activate Tip on. This is through NSService.

The privacy and security is top notch. Kudos to Apple who provides such good frameworks.

You can try requesting the app to be allowed from your IT team. I did this at my company (i.e. Stripe) as well.

Thanks. I'll look into it and see how it goes.
Are you planning to compile this for Apple Silicon? I've been trying hard to avoid installing Rosetta on my new MBP (not that I've heard anything bad, I just don't want to even have to think about it when they finally drop support).
It should work with M1.

I just got M1 last week, and it works.

Please let me know if it doesn't.

It probably works, but it prompts me to install Rosetta, so I clicked cancel, as I've been trying to avoid that on principle. I'm not sure what principle exactly...

Obviously I'm not expecting you to go out of your way, but was wondering if you had plans for native support.

Maybe my work laptop has Rosetta by default.

I do have plan to compile a native one. I will see when I can recompile it on M1. Thank you for letting me know.

I'm very interested that you can open Intellij code. Do you have example code from your GIF you could link?

Is Intellij opened with the type url or a script?

Can't wait to use this! Thanks

Yes. You can open the below URL:

idea://open?file=/home/user/file/path.scala&line=56

VSCode has one too

vscode://file/home/user/file/path.js:56

That's pretty cool. I wish linux had such abilities. I have a similar app-specific launcher to call scripts, but the best I can use are keys, so I just fire ctrl-c or such, wait some seconds and have something useable in a separate dialog. Such an integrated tooltip seems to be far better than this.

Thinking about, MacOS has a long history of well integrated automation, with AppleScript, external callable function per window/app and they even had automator at some point. Not sure what happened to it. Linux had something similar with KDE and dcop, but it died at some point.

I agree. I was thinking about building it for linux, but there's no equivalent mechanism. I was thinking about utilizing clipboard instead.

Apart from that, AppSandbox + NSUserUnixTask + NSService reallt enable this use case to have the highest privacy level. Without these 3, I would have had to request pervasive permissions on user's machine.

I don't really "automate" in the usual way, except a few limited cases. My computer is almost totally lacking any custom scripts, and I don't have any cron jobs on my laptop or anything like that.

Mostly what I do is build the workflow to match pre-existing tools, rather than build tools to match a workflow.

I do use a massive amount of off-the-shelf automation though.

Even for very small personal servers, I make sure that everything is Ansible-ed.

I make a lot of use of Obsidian features like daily notes templates, I use YoSmart and Tile, etc. I keep my entire music collection, all my books, and some important documents synced with SyncThing on all my devices.

But in general I just don't have a reason to automate much of anything, I try to choose things that just work, and if that's not possible, I try to do it at the source(I'd rather add support for another file format, or switch to a tool that has wider support, that add a converter utility).

I'm pretty obsessed with future proofing, and usually choose large and popular software, so it's rare that I want a feature that isn't already there.

Everything I can.

I (unfortunately) mostly work on windows machines. I use autohotkey extensively. Amazing at gluing disperate software together, hotstrings, hotkeys; and as a programming language, for a beginner, the documentation is second to none.

I have extensive bookmarklets for doing stuff in browser where autohotkey can't see much.

And like you, since I have to work in ms office, VBA is a must. Autohotkey can do VBA too but sometimes it's just easier in app.

I’m interested in others’ specific automation examples, especially around ensuring important-things-to-be-done are bright front and center at the right time.

Mine are:

- Context switching (ala GTD) e.g. switching to dev-mode, or buisdev-mode, or analytics-mode

- Focused variants. Same as above but all others things are shutdown

- All devops and the automations are the documentation

- Switching light/dark mode (aka garden vs office work-modes)

- Data wrangling (moving important data around)

I’m missing health-monitoring automations but I’ve not yet clearly worked through what I want here (but i like what Bearable are doing).

I made basics bash scripts to do some simple stuffs. Scripts I use more often are:

1. A script who help me to make conventional commits name (ex: `feat(xyz): add some stuff. JIRA-ID`). It add Jira Id at the end using git branch, get scope using path of the folder and ask me the rest

2. Create a markdown file for the day as worklog. An another script create markdown file for the Jira issue that I work on and add a wikilink on the worklog

3. Read scripts in package.json and ask me what I want to execute using fzf

I try to do more and more since it's really useful and I had some fun to made them.