Skip to content

AppleScript Tips: Inspecting Objects, Modal Dialogs, and More

AppleScript is an amazing, quirky tool within the macOS ecosystem. It enables you to control any application on your Mac, even if the original developer didn’t explicitly write an API for it. This can be incredibly useful when attempting to automate certain actions. However, the language is incredibly weird and confusing, especially to a "real" software developer. I’ve compiled a list of tips and tricks below that help me write various tools and scripts to automate my computer (I’ve written about applescript before in case you are looking for other tricks)…

Continue Reading

Using the Multiprocess Library in Python 3

Python has a nifty multiprocessing library which comes with a lot of helpful abstractions. However, as with concurrent programming in most languages, there are lots of footguns. Here some of the gotchas I ran into: Logging does not work as you’d expect. Global state associated with your logger will be wiped out, although if you’ve already defined a logger variable it will continue to reference the same object from the parent process. It seems like the easiest solution for logging is to setup a new file-based logger in the child process. If you can’t do this, you’ll need to implement some sort of message queue logging which sounds terrible. Relatedly, be careful about using any database connections, file handles, etc in a forked process…

Continue Reading

Building a Crypto Index Bot and Learning Python

A long time ago, I was contracted to build a MacOS application using PyObjc. It was a neat little app that controlled the background music at high-end bars around London. That was the last time I used python (early 2.0 days if I remember properly). Since then, python has become the language of choice for ML/AI/data science and has grown to be the 2nd most popular language. I’ve been wanting to brush up on my python knowledge and explore the language and community. Building a bot to buy a cryptocurrency index was the perfect learning project, especially since there was a bunch of existing code on GitHub doing similar things. You can view the final crypto index bot project here. The notes from this learning project are below…

Continue Reading

How to install an old HomeBrew package

I accidentally ran brew upgrade on a set of packages which caused brew to bump most library packages that were installed on my computer. This caused issues compiling PHP via asdf. I thought it would be easy to install an older version of the offending package, icu4c, but I was very wrong. In recent (2021?) versions of brew. I ended up learning a bit about the homebrew internals and solving Installing an old version of icu4c to fix PHP compilation on macOS I discovered the offending package was icu4c, but the PHP compile script did not indicate that I was using an unsupported package version…

Continue Reading

Scripting macOS with Javascript Automation

I’ve been playing with ActivityWatch, a really neat open-source application to track what you are doing when you are on your computer. Similar to rescue time RescueTime, but open source, with some more advanced features. I’ve been using it for a couple of months as part of my digital minimalism toolkit and it’s worked great to give me an idea of what’s taking up my time. There’s been a couple of things that have bugged me about the application, and it’s written in a couple of languages I’ve wanted to learn (Rust, Vue), so I decided to make a couple of changes as part of a learning project. I ended up needing to modify an AppleScript and ran into macOS’s Javascript Automation for the first time…

Continue Reading

Migrating from bash to zsh

I love productivity tools. Anyone who works with me knows I love my keyboard shortcuts and tiny productivity hacks. Small, incremental productivity improvements add up over time: feeling fast makes you fast. Plus, I just enjoy tinkering and making things more productive. One of the rabbit holes I love to go down is optimizing my development environment. I spend a lot of time in a terminal, so it’s a fun place to optimize my setup. Ever since hearing of Oh My ZSH I wanted to try out zsh, so I set aside some time to update my dotfiles to use zsh as the default shell. Below are some notes & learnings from the transition. What’s new in zsh? There are lots of small packages out there for neat things like autocomplete, async prompts, etc…

Continue Reading

Dumping a AWS RDS Database to Your Local Machine

I’m a big Heroku fan. I used it’s hosted Redis and Postgres services for my startup and it scaled incredibly well and saved me a ton of time not having to ever worry about devops. One of things I loved about Heroku was it’s CLI API. You could very easily manage infrastructure through a very thoughtful CLI. For instance, a common process I would run was: Dump production database to my local Import the dump into my local Postgres Clean & sanitize the data This process looked something like: That first line was all you needed to download a production copy of your DB. I’ve been playing around with AWS for a side project and replicating a similar process was surprisingly challenging…

Continue Reading

Learning Clojure by Automating an RSS Reader

I’ve been working on revamping how I consume information. Most of my information consumption has been moved to RSS feeds, but I can’t keep up with the number of articles in my feeds. When I take a look at my reader I tend to get overwhelmed and spend more time than I’d like to trying to "catch up" on information I generally was consuming out of curiosity. Not good. I want articles to be automatically marked as read after they are a month old to eliminate the feeling of being "behind". This is a perfect little project to learn a programming language that’s looked interesting for a while! Building a small project in a new language or technology is the best way to learn…

Continue Reading

Archiving a QuickBooks Online Account to QuickBooks Desktop

If you run a small business, you probably use QuickBooks. I’ve been impressed with the product: the rate of improvement continues to stay constant over the last couple of years (one of the most important criteria in picking a software platform for your business!) and it’s surprisingly pleasant to use. If you close a company, you’ll want to archive all of your QuickBooks data for at least a couple of years in case you get audited. However, QuickBooks Online does not have a low-cost “audit backup” option to access a read-only version of your data. If you cancel your subscription, you only have 90 days to reactivate your subscription and restore your data…

Continue Reading

How to Create a Custom Field to a NetSuite Customer or Transaction

NetSuite custom fields are incredibly powerful and flexible, but they are not easy to work with! Below is a quick guide that walks through how to create customer and transaction custom fields and some tips and tricks for working with custom fields. How to create a custom customer (i.e. entity) field in NetSuite: Navigate to: Customization > Lists, Records & Fields > Entity Fields > New Label: use a name you’d like to see displayed on your customer. Type: “Free-form Text”. There are cases where you won’t want to use free-form text, but in most cases this is the best option. ID: “_a_internal_identifier”. Note that you should start your identifier with a _ since custentity will be prepended to whatever you provide here…

Continue Reading