72: Quality of Life Automation on the Mac

2 Likes

I am listening to episode 72 now and you are discussing using Moom. I remember a presentation at a Mac user group last year (via Zoom) that was given about using Moom with “Bunch” written by… Brett Terpstra <DRINK!>. Figured this might help someone else. And it’s Friday, so have another drink!

About Bunch:

Link to an article on Using Moom with Bunch…

1 Like

Just sharing a quick QoL macro.

I’m a huge fan of using URLs to mail messages for future reference on projects. That said, I don’t like the fact that whenever I click back on the mail app, it will also bring to the front the perilous Inbox with its never ending temptations to switch tasks.

So I’ve made a Keyboard Maestro Macro that will work alongside the Focus app:

  1. Whenever I’m on a Focus session, I have its script capabilities run a Macro that will write “on” to a Keyboard Maestro variable named focus, conversely it will change it to “off”. should its previous state be “on”;
  2. Then the magic will happen with the Macro bellow: whenever I activate Mail. it will look for the title of the front Window and if it contain the word Inbox (ot Inboxes for also matching the unified inbox), it will close that window only.

That will allow me to keep Mail running for both referencing linked messages and composing new ones (also a Keyboard Maestro Macro set to Hyper+M for opening the a url mailto:).

3 Likes

I like my Apps to be up-to-date.

MacUpdater is a useful App for that (though not fully automatic).

A couple of apps that came up on this week’s episode were Amphetamine and Keyboard Maestro. One of the quality of life things I’ve done with both of them is tie them into Alfred workflows … both of which I happened to post about earlier in the week before the episode came out. While these apps certainly improve quality of life on the Mac, I believe that you can also improve your quality of life when using these apps.

The Alfred workflow for Amphetamine (Dose) allows you to enable on/off, on for x mins/hours, a standard set of remote triggers, and set-up of your own triggers (hot keys, remote triggers, etc.) through an external call.

The Alfred workflow for Keyboard Maestro (Conductor) allows you to trigger macros by name (note, macros displayed alphabetically sorted for filtering), trigger delayed execution, copy their URL, open them for editing, enable & disable macros/groups.

Hopefully, others will find that these workflows can improve the quality of their Mac life too :apple: :desktop_computer: :slight_smile:

1 Like

Thank you! I was looking for a way to to do so since the previous workflow I used for this is not working on M1 with Big Sur.

That’s good to know. I don’t have an M1 Mac, and haven’t updated to Big Sur just yet (been no driver and the usual teething issues with apps that have been against the upgrade for me … but I will update at some point).

I also used to use the same Alfred Maestro workflow previously; but I explain in the blog post my reasons for creating my own workflow. I hadn’t even realised it had M1 issues :man_shrugging:t2:

Suggestion for Keyboard Maestro use:

I am enrolled in a few online learning classes. Often, soon after enrolling, I forget about them. If I put them in a task list, it’s too easy to just check it off as competed for that day without actually doing it. I set up a KM automation to use a time-of-day trigger to open a URL at a time when I’m likely to be in front of my monitor. For instance, I open a language class I am at taking at 7:30 PM on Monday, Wednesday, and Friday. I found getting the website “in my face” is a good stimulus to at least complete a lesson for those days.

So. Think about time-of-day triggers for opening URLs that you need to be reminded of.

Tony

1 Like

There’s something with some Go dependencies not being ready for primetime in M1, discussed here.

Anyways, happy to report your workflow is running really smooth on M1! :slight_smile:

I would also like to thank you for prompting me on this on another post:

I was peaking at your Python code on this workflow and it is a really good example of its capabilities for general automation and quick scripting. Thanks again for that!

QoL

HomeControl + Keyboard Maestro + Streamdeck

With HomeControl, I can trigger Hue light Scenes via AppleScript. Now, with Keyboard Maestro, I have StreamDeck keys such as:

Lock Computer (when I’m stepping out of the office)

  1. Trigger the Lock Screen
  2. Set the office lights to a nightlight mode
  3. Send a Pushcut notification to my iPhone asking if I want to run a Shortcut (which is a menu of actions I might want to use when I’m walking out of the office)
  4. Pause for 90 seconds
  5. Turn the Office lights completely off. (I do this so I’m not walking out of the office in the dark, but I don’t have to turn the lights off after I walk out of the room either)

Launch Zoom

  1. Launch the Zoom app
  2. Change the office lighting to my zoom-friendly hue scene
  3. Change my stream deck to a different configuration meant specifically for Zoom

In Keyboard Maestro, I can also use a HomeControl AppleScript as an alert when some other condition is triggered.

None of this is necessary at all, but it’s really helpful.

1 Like

Another fun episode. WRT Amphetamine, I’ve been using caffeinate from the macOS command line for years.

I have been listening to this episode, and wanted to share one quick, easy Hazel automation I use.

I commonly take screen shots in order to support customers or document a process. More than likely, I will never use these screenshots again. Hazel leaves them on my desktop, and in one hour, clears them to an archive folder. If they stay there for 30 days, they get deleted. Another rule clears my desktop of anything not in one of two specified folders on my desktop - Inbox or Scanned Inbox (from the ScanSnap). This runs at 5:30 PM every day. They go to archive folders and are managed there.

Before, screenshots would take up so much of my screen, and there was a lot of mental energy expended into “Keep or toss?” Now, the decision is made, and mental energy is saved!

Well worth the money for Hazel!

2 Likes

I have two little automations programmed into Keyboard Maestro that help with notifications, specifically dismissing them. I cribbed this from Tyler Hall’s piece “240 Invisible Pixels”.

Dismiss all notifications … pressing CTRL-CMD-SHIFT-OPT-BACKTICK clicks the X on a notification stack 2x. I have it click 2x just in case there are >1 notifications because Big Sur requires the additional Dismiss All click.

Snooze Notifications … when I have a calendar notification, pressing CTRL-CMD-SHIFT-OPT-1 clicks the options drop down in the calendar notification and then clicks snooze.

Keyboard_Maestro_Editor_—_SA__Snooze_Alert

I have CTRL-CMD-OPT-SHIFT mapped to CAPS LOCK, so I can do those two actions with a quick roll of my left hand. The only caveat is that the mouse stays in the top right corner of the main monitor, as I can’t figure out how to get KBM to move the mouse back to wherever it was before I triggered the macro.

One other little automation I have helps me jump into my company’s ticketing system in Jira. So rather than have someone send me a link to the ticket in an IM, I can ask them for the ticket number (or read it from the Zoom window) and jump right to the ticket.

  • triggered via HYPER-J
  • Because I sometimes have the ticket number already on the clipboard, I have the Prompt dialog box pre-fill that into the dialog response.
  • I didn’t bother creating any sort of logic to figure out whether there’s a legitimate ticket number on the clipboard because the KBM dialog box already has the pre-filled text selected. So if I start typing something, it replaces what’s already there.
  • In the final bit of the URL, the /MS- is specific for my company’s ticketing system and has to do with the Jira project in which the ticket lives.
  • Also note that I have a Filter Variable with Trim Whitespace in the second to last step. That’s just in case if double clicking the word selects the trailing space. Note sure if its really needed, but its an easy step that makes me feel better. ¯\_(ツ)_/¯

I installed this (twice) but I can’t get the main ‘km’ part to run. When I type ‘km’ in Alfred the workflow isn’t shown as an option. I tried changing the keyword. I’ve got python 3 installed.
Any ideas?
Thanks.

If the workflow is installed, it should show in your workflows list in the Alfred’s preferences. Does it show there? If not, do you have the Alfre Powerpack?

Next up, what happens if you install this workflow, and type pythontest abc into Alfred?

2021-04-11-19.20.58

The script it runs is this:

#!/usr/bin/env python3

import sys

strArg = ' '.join(sys.argv[1:])

sys.stdout.write('START>>>')
sys.stdout.write('You entered "' + strArg + '"')
sys.stdout.write('<<<END')

If everything is in place, then you should get this displayed on the screen.

If it doesn’t work, try some Alfred workflow debugging:

https://www.alfredapp.com/help/workflows/advanced/debugger/

I have added a debug block after the script in that test workflow for convenience.

If that isn’t giving anything, my best guess would be an issue with thePython 3 installation.

If you type ls /usr/bin/py*3 in at a terminal, do you get /usr/bin/python3 as the result?

Thanks very much for your help! It’s working perfectly now :slight_smile:

I used the Python Test workflow to debug it. I needed to install Command Line Tools. Thought I had already…

2 Likes

I use Alfred’s “Web Search” ability for this. Set up a url for a given website, adding a {query} string that is resolved and substituted when Alfred is used to perform the search. For instance, if jira 111 is typed into Alfred, it will go to your url with 111 inserted in, like yoururl/browse/MS-111.

I have also set up similar Web Searches that go directly into websites I commonly search, like big chain stores, avoiding all the advertising and getting straight to the content I’m interested in. I also use it for searching forums (like this one).

:man_facepalming: … I totally forgot about that!!
I just set up a bunch of them in Launchbar, including the forum searches.
Thanks @scott.dellar !