Tiny automations that save me hours of time at work
I am always a little surprised when I see other developers doing things manually that can totally be automated. Not a slight, I just find it interesting that we are all paid to automate things over there, but it can be easy to miss the potential up close.
I make good use of AutoHotkey and Python scripts at work, and today's post will list some of the many ways I have found to make my life easier, reduce manual labor and sometimes completely automate repetitive steps that I have to do every day - sometimes several times per day.
When we receive error reports from our clients, we usually have to download the related data, then manually insert our own user data as well as fix some other parameters in that data so that production errors can be debugged in the dev environment. This can take up up 10 minutes to do by hand (with potential to forget one part and having to redo it). But they are all just text replacements, so I built a VS Code macro that replaces the data for me.
I then realized that I was still manually sending the file as a web request using postman, so I first generated a python GUI with a drag&drop window that handled the text replacements and then sent the file to my endpoint. This would have taken quite some time back in the day, but with ChatGPT, it took less than ten minutes from idea to sending the first request.
I found it annoying to start the GUI every morning, so I investigated if AutoHotkey can send web requests (what CAN'T AutoHotkey do?), and now I just have a keyboard shortcut that opens the newest file in my download folder, replaces the data, and sends it as a web request. Again, generate that shit, it takes no time at all when it would have taken me an hour to write and test a few years ago.
I work on three different projects and we have to track everything we work on so that it can be billed to the right client. So I wrote a simple AutoHotkey script that opens a little popup input field where I type what I am working on, and it appends that to a csv file that I can import into our time tracking tool once per week. Easily one or two hours saved per week on overhead, and I never have to wonder what I was working on Tuesday morning at 10.
I write a lot of words for emails and JIRA tasks, documentation and Teams messages. I would rather not fix manual typos all the time, so I am using an AutoHotkey script where I can press capslock (formerly the most useless key on the keyboard), it selects the last-typed word, and I can enter a replacement for it. I use the same script to write this blog post on my private laptop, and the list of fixed typos and abbreviations is now 19,000 lines long. I once calculated that a single typo costs about a minute when you are fast at correcting it, never mind the people who manually select it with the mouse, delete a single letter, then click again to type that letter where it belongs. A surprising amount of time is wasted to focus loss, pausing to type, remembering what you wanted, as well as someone in a meeting who keeps talking while you are trying to take notes, so now you are trying desperately to catch up with your notes to what they are talking about now. You can , apparently it is from 2011 and I have been using it for many years, once even losing my complete list of replacements when my computer died a sudden death. All you have to do is change the trigger key to capslock, and it will now be faster to correct a typo than it is to manually correct it even once (capslock is one keypress less than even control-backspace, and very few people even know you can do that)
Back to work stuff: We often have a case when the system we maintain has an error in the job log, so now you want to look at the files in the server directory. This as well is reachable via web interface, but you need to take the job url and calculate the correct folder path from it, then open the basic storage url and append your url. This is slower than manually logging into the server and searching for the job ID, but it is repeatable so I could write an AutoHotkey script that handles the calculating and opens the dev/stage/prod environments depending on which shortcut I use to trigger it. Now, it is instant instead of taking like five minutes of manual clicking. I do this step multiple times per day, and sometimes have to compare between the different environments to compare. Probably saves me an hour per day.
Instead of manually checking for errors, I have written Python scripts in every job I've ever worked that either queried the database, or even Selenium scripts that automatically logged into the server and did the steps to filter for errored jobs, and report back if anything needs my attention. Not having to manually check anything saves more than just the time it takes to click, you also have to remember it, set reminders, and can't do other work in that time. And you still might miss something, or check a minute before things crash, while the script can run once per hour if you like to nobody's detriment.
You can query your Outlook inbox from a Python script, so you can do more than the basic Outlook Alerts can do, for example using email triggers to generate JIRA tasks. I can't say I use this much because there are usually better ways of doing anything I can think of, but as written here, sometimes it really comes in clutch, and I want to raise awareness that it was trivial to generate the script needed, and now I keep thinking about ways to use that workflow. Maybe I could automate quoting my boss's newest email and automatically send a 🙄 emote in our internal chat, that could save me five minutes per day. Kidding aside, there are some edge cases where this process could come in super clutch, especially in cases when we have to deal with layers of bureaucracy or other road blocks.
I sent my boss an executable script with a GUI for one of my scripts that he used to need my help for quite frequently, and in my opinion, this option to have a GUI generated for an existing script is a highly overlooked application for LLMs. Most people can't run scripts, even if you tell them to and give them a written guide with screenshots. They will simply not do it, even if you created a batch file that they only need to double-click. They need something visual or they get scared of it, and I haaaaaate GUI development, so now everyone is better off. I don't see that talked about nearly enough, it's amazingly useful.