As of October 2020, if you go to Microsoft’s site and download the very latest version of Teams and install it on a brand new Mac running the very latest version of macOS with all patches applied and all the default settings set, the Teams app will fail to log you in because it thinks it can’t see the internet. You’ll get a cryptic error that includes the phrase “Failed to connect to settings endpoint”.

The fix for this is really simple, but it took me for ever to find, so I figured I’d share it with the world and perhaps save other some stress ?

Read more

Tagged with:

While I wrote these MacOS Quick Actions to scratch my own proverbial itch, I think they could be of use to others, so I’m releasing them as open source.

The actions allow you to calculate the word count, line count, and character count of selected text, to convert a text selection to upper case, lower case, or title case, to do the same to the contents of the clipboard, and to convert the clipboard from rich text to plain text and to trim the contents of the clipboard.

You can download the actions and read the docs on GitHub.

As well as describing what each of the Quick Actions do, the GitHub docs also describe how to install the actions, how to use them, and how to assign keyboard shortcuts to them if desired.

If you’re curious to learn how these Quick Actions work, read on.

Read more

Tagged with:

How often does someone email you a file who’s content you need to copy-and-paste into a web form of some kind? Maybe it’s just me, but I find I need to do it a lot!

What I wanted was the ability to right-click any file with plain-text content (text, markdown, XML, JSON, Certificate Signing Requests, …) and send its content to the clipboard.

By combing Automator, the cat and pbcopy terminal commands, and a little JavaScript, I was able to build a nice service that can be accessed by right-clicking any file in any app that reports its outcome using a standard OS notification.

Download the Quick Action here, extract it, and copy it to your ~/Library/Services folder.

Read more

Tagged with:

This post is part 1 of 6 in the series Bash to Zsh

During their 2019 World Wide Developers Conference (WWDC 2019) Apple announced that the default command shell for their next OS release (macOS Catalina) from the Bourne Again Shell (Bash) to the Z Shell (Zsh). Not only will Apple be switching the default in Catalina, they will be removing Bash completely in an as-yet unspecified future update. Apple’s advice is clear — make the switch now so you’re ready!

Never being one to try hold back the tide, I dove right in and made the switch within 5 minutes of reading about the announcement. This series will document my experience of making the change.

Read more

Tagged with:

This post is part 2 of 6 in the series Bash to Zsh

Apple recently announced that it’s moving the MacOS from the Bourne-again Shell (Bash) to the Z Shell (Zsh), and advised developers to make the change now, so they’re ready when they remove Bash altogether in some later version of the OS. Since I’m a big believer in not swimming up-stream, I decided to take their advice and switched to the Z Shell immediately.

The first thing I noticed was that the default prompt Apple provides for Zsh on their OS gives a lot less information than their default for Bash did. This is a sample of their old Bash prompt:

bart-imac2018:Documents bart$

That tells me the machine I’m on (bart-imac2018), the folder I’m in (Documents), and the username the shell is running as (bart), and whether or not I have super-user privileges ($ means no, # means yes). These are all very useful things, particularly when you SSH around a lot and su/sudo to different accounts. Also, IMO showing only the top-level folder rather than the full path gives a nice balance between the prompt getting too big, and not knowing where you are. I’ve never felt an urge to change the Mac’s default Bash prompt.

I can’t say the same about the Mac’s default Z Shell prompt! This is what I get on the same machine with the Z shell:

bart-imac2018%

It only shows the machine name (bart-imac2018) and whether or not I have super-user privileges (% for no, # for yes)!

Thankfully getting back to the old Bash-like prompt is easy — the TL;DR version is that you simply need to add the following line to your ~/.zshrc file:

PROMPT='%m:%1~ %n%# '

If you’d like to understand how exactly that works, and what other choices you have, read on!

Read more

Tagged with:

Due to a problem with the File::HomeDir Perl module on recent versions of MacOS, the usual one-step instructions for installing Crypt::HSXKPasswd from CPAN don’t work on Macs ATM (June 2019).

TL;DR

sudo cpan -f -I File::HomeDir
sudo cpan Crypt::HSXKPasswd

Read more

Tagged with:

Note: This is an improved version of my original solution to this problem.

As a reminder, the problem to be solved is to have screenshots automatically appear in Yoink as they are taken. Again, as a reminder, on macOS, screenshots are saved to the desktop as files with names of the form Screen Shot YYYY-MM-DD at HH.MM.SS.png, e.g. Screen Shot 2017-11-22 at 22.30.10.png. And one final reminder — Hazel is an app that watches the filesystem for events, and executes actions in response. Hazel rules are added to folders.

My original solution was to add a Hazel rule to the desktop folder with the condition Name starts with Screen Shot and a single Shell script action which used the open terminal command to send the screenshot to Yoink. The good people at Hazel replied to my tweet about the original post with a suggestion: I think you can do the same thing without a script. Try using the “Open” action.

Unsurprisingly, the Hazel suggestion proved to be spot on.

Read more

Tagged with:

Note: based on feedback from Hazel via Twitter I’ve improved on this original Hazel rule, described separately here.

One of my favourite app discoveries of 2017 has been Yoink — a Mac an iOS app that revolutionaries drag-and-drop by simply providing a shelf where you can temporarily store anything drag-and-dropable as you switch between windows, apps, and even spaces. I reviewed Yoink on episode 496 of the Chit Chat Across the Pond podcast.

Anyway, I use the Yoink all the time, but, it’s missing what I believe would be a fantastic feature — the automatic addition of screenshots to the Yoink bar as you take them.

I contacted the developer to suggest/request this as a feature, and he didn’t seem all that interested in adding it, but, he did make two suggestions for how I could go about getting the functionality I wanted indirectly. He made two suggestions — buy a different app of his, ScreenFloat, which is specifically for managing screen shots, or, build an automator script to take screenshots and send them to Yoink.

This week I finally found a simple solution I’m happy with — Hazel combined with a simple terminal command.

Read more

Tagged with:

This post is part 37 of 39 in the series Taming the Terminal

Since we covered SSH in parts 29 & 30, Apple have changed how their desktop OS deals with the passphrases protecting SSH identities (key pairs). This provides us a good opportunity to have a look at the SSH Agent in general, and, how things have changed on the Mac in particular.

The good news is that while things have changed on the Mac, with a small amount of effort, you can get back all the convenience and security you had before.

Read more

Tagged with:

Earlier this week I posted a review of the Mac window tiling app Magnet which is currently on sale in the Mac App Store for €0.99. @DriesDeRoeck replied on Twitter to point me nice free and open source alternative – Spectacle.

Read more

Tagged with:

keep looking »