Category Archives: How To (Mac)

How To Write macOS Command Line Tools with Swift

I’ve spent a lot of time of late working on several macOS command line tools written in Swift. So I’ve gathered together the key points I’ve learned while creating and updating pdfmaker and imageprep: some best practices and ways to deliver many of the features common to programs the run at the command line.

imageprep running in Terminal
Continue reading

How to Script macOS Command Line Tool Notarization and Packaging for Distribution

A few posts back, I talked about the script I use to package macOS apps that I distribute outside of the Mac App Store. That script is designed to simplify the complex process of signing and notarizing not only the app itself but also the installer package its ships within. This is all made necessary by the ever more rigorous, annoying but necessary security provisions Apple is applying to macOS.

Continue reading

How to take control of macOS Finder window sizes

I don’t know if this is a glitch in my system — I see it in a couple of machines, though both have the same config — but under macOS Catalina, Finder has an annoying habit of ignoring the size of windows. Pop up a new Finder window and it’s just a small quarter-of-screen panel at the top left of the desktop, not the much larger panel that the most recently closed window was.

Continue reading

How to quickly package macOS apps for distribution outside the App Store

Preparing a macOS app for distribution through the App Store is fairly easy using Xcode, but to do so for apps that you plan to distribute as a binary by other means — as a download from your own website, for example — isn’t straightforward, and it has got more complicated over recent macOS releases.

macOS app package icon
Continue reading

How to provide file icon thumbnails in macOS

Update My PreviewMarkdown app, which provides Markdown file previews and icon thumbnails in Catalins, is now available from the Mac App Store.

Providing content-based icon thumbnails in macOS Catalina follows the same pattern as generating file previews: QuickLook runs code from an app extension and calls a function within that code to draw the image that will be placed on the icon.

thumbs
Markdown file previews in Catalina, courtesy of PreviewMarkdown
Continue reading

How to create file previews in macOS

Update My PreviewMarkdown app, which provides Markdown file previews and icon thumbnails in Catalina, is now available from the Mac App Store.

macOS Catalina introduces a new mechanism for providing file previews and content-based file icons. The system for doing this is still QuickLook, but the standalone or app-hosted QuickLook generators that have been in use for some time have been deprecated in favour of delivering this functionality through app extensions.

preview_cat
A Markdown preview in Catalina, courtesy of PreviewMarkdown
Continue reading

How to fix iCloud bookmark sync glitches

Has iCloud and/or Safari just borked your bookmarks? This happened to me yesterday; here’s how I fixed it…

Continue reading

How to make one PDF from multiple images on macOS

Google the title of this post and you will get plenty of results, but all almost all of them steer you toward opening the image or images in macOS’ Preview app and exporting to PDF. Yes, this method works, but it doesn’t give you much control over the process, and it’s not scriptable.

Continue reading

Make a Mac ‘Task Done’ NeoPixel notification light

Update There’s now a new post containing revised, working instructions for this project.

Note This article was written some time ago, and the libraries used do not work with recent versions of macOS.

I regularly back-up my Raspberry Pi storage card because it’s so easy to damage the card with an improper shutdown or some such. I back up to a Mac, and you can read how I do it here. This wasn’t much of a chore in the early days when I was working with 4GB cards, but now I use 16GB Micro SDs and I know of folks who have much, much larger storage capacities thanks to never-cheaper cards. All this means the back-up takes a long time. So I wondered if I could create a gadget to tell me the task was done, allowing me to get on with other jobs in the meantime.

Continue reading

Connect a Raspberry Pi to a Mac using a USB-Serial adapter

I’m enjoying tinkering with the Raspberry Pi. Alas most of the tutorials and guides available online, of which there are many, focus on hooking the tiny board computer to Windows or Linux machines. Mac-centric guidance is sparse, and I could have used some this week.

A Pi's UART pins, connected
A Pi’s UART pins, connected
Continue reading