Overview

Mac Automation is a free actions plugin for the Elgato Stream Deck. It brings together a number of useful actions for those who like to automate things on their Mac. If you have a Mac and a Stream Deck, then you are probably one of those people.

You may already have plugins that provide some of this functionality. This plugin is intended to be complementary, so if everything works for you already, do not feel compelled to swap. Plugins can be quite opinionated and this plugin perhaps just offers some alternatives and they may be for you. They may not. It’s all good. Hopefully, there will be at least one or two actions which you will find useful.

Download from the Official Elgato Marketplace:

Download Mac Automation on the Elgato Marketplace

This Plugin is Free

This is a free plugin, but if you like it and want to say thanks, I am a coffee lover and you can always buy me a coffee via the button below. As a bonus, you can also follow me there to get monthly updates on what I am getting up to which tends to include quite a bit of Mac-based automation.

Mac Automation Actions

The plugin currently supports the following actions:

  1. Run Open
  2. Run Shell Command
  3. Run AppleScript (Script)
  4. Run JXA (Script)
  5. HTTP Request (curl)
  6. Run Shortcut (Manual)
  7. Run Shortcut (From List)
  8. Run KM Macro (Manual)
  9. Run KM Macro (From List)

There are some further details below on each of these actions along with some examples of how they can be utilised. In many cases you would have to substitute something local to your machine to produce a working example of your own, but hopefully, they illustrate some of the things you could do.

Run Open

This action is a generic opener. It uses the power of the command line open command to process the specified input.

Notably, using this to trigger URLs works around the restrictions introduced by Elgato on the Website action when they introduced the default browser option.

Examples

The following examples show the sorts of settings you might use with this action.

Preview Image

Open a Website in the Default Browser

Run Shortcut via URL

Run Shell Command

The Shell Command action can be used to run any arbitrary command line instruction. This could be a terminal command or even a path to a shell script (that has been set as executable. This latter one is what I would recommend for non-trivial commands as you can run it from other tools too, and it makes it super easy to debug and build more complex automations.

Examples

The following examples show the sorts of settings you might use with this action.

Play Audio File

Call a Script File With Arguments

Run AppleScript (Script)

This action allows you to run AppleScript. Not arbitrary AppleScript, only AppleScript saved to file.

The action includes a button icon for an open dialog that will let you select an uncompiled script. For a compiled script you can enter the path manually, including pasting it in from the clipboard.

If you really want to run arbitrary AppleScript, there is at least one plugin that does that explicitly, but I would also note that you could run it via osascript -e in the Run Shell Command action.

Run JXA (Script)

This action allows you to run JavaScript for Automation (JXA). Not arbitrary JXA, only JXA saved to file.

The action includes a button icon for an open dialog that will let you select an uncompiled script. For a compiled script you can enter the path manually, including pasting it in from the clipboard.

If you really want to run arbitrary JXA, there is at least one plugin that does that explicitly, but I would also note that you could run it via osascript -l JavaScript -e in the Run Shell Command action.

HTTP Request (curl)

This action uses the curl (Client URL) utility to carry out some data transfer. I often use it to trigger API end points or grab the content of a web page for processing. It is the former that is probably of most use for this action. The action allows you to pass a URL to the curl utility, along with any additional parameters you might want. Selecting the Security option will utilise the curl command’s -k flag to ignore certificate errors.

Unlike the Run Open action, this is not opening the URLs in your browser, but rather, it opens them in the background.

Examples

The following examples show the sorts of settings you might use with this action.

Trigger a Local HTTP Service

Trigger a Local HTTPS Service Insecurely

I sometimes end up setting up services on my home network that run over HTTPS, are isolated from the open Internet, but that I also then don’t put a security certificate on. curl allows you to ignore certificate errors for these sorts of scenarios.

Run Shortcut (Manual)

The “Manual” version of the run shortcut action lets you just enter the name or the ID of the shortcut.

As well as a name, Shortcuts also have a unique ID (a v4 UUID) that does not change if you rename a shortcut. If you use the name in an action and rename the shortcut you will need to update the action. If you use the shortcut ID you will not.

One quick way to get the ID is to use this ZSH one-liner that will put the ID on your clipboard when you enter (it prompts you on run) a filter string, Just make sure the filter string is enough to uniquely identify the shortcut by name.

print -n "Filter: "; read filter; shortcuts list --show-identifiers | grep "$filter" | sed -En 's/.*\(([A-Fa-f0-9-]{36})\)$/\1/p' | tee >(pbcopy)

Alternatively, if you are an Alfred app user, you might want to check out Bypass, my Alfred workflow for Apple Shortcuts that lets you grab the ID of a Shortcuts shortcut right from Alfred.

You can optionally specify a string to be passed as input to the shortcut. There is no need to wrap these in quotes - the content will just be passed in; but your shortcut must be designed to make use of such input otherwise it will have no effect.

Examples

The following examples show the sorts of settings you might use with this action.

Shortcut by Name

Shortcut by ID

Run Shortcut (From List)

The “From List” version of the run shortcut action lets you just select a shortcut from a drop down list of all of the available shortcuts. The list supports filtering and as you type into the list of available shortcuts it will reduce the list of matching shortcuts making it quick to select it if you perhaps are not 100% sure on the name.

The action is storing and using the shortcut ID behind the scenes, so if you rename your shortcut, the action should continue to work, because the unique ID does not change.

You can optionally specify a string to be passed as input to the shortcut. There is no need to wrap the string(s) in quotes - the content will just be passed in; but your shortcut must be designed to make use of such input otherwise it will have no effect.

Examples

The following examples show the sorts of settings you might use with this action.

Run a Shortcut

Run Keyboard Maestro Macro (Manual)

The “Manual” version of the run Keyboard Maestro macro action lets you just enter the name or the ID of the Keyboard Maestro macro. Both of these are easily accessible within Keyboard Maestro - the ID being found at Edit > Copy As > Copy UUID.

Once again, if you are an Alfred app user, you might want to check out Conductor, my Alfred workflow for Keyboard Maestro that lets you grab the ID of a Keyboard Maestro macro right from Alfred.

You can optionally specify a string to be passed as input to the macro. There is no need to wrap these in quotes - the content will just be passed in; but your macro must be designed to make use of such input otherwise it will have no effect.

Examples

The following examples show the sorts of settings you might use with this action.

Run Macro by ID

Run Macro by Name

Run Keyboard Maestro Macro (From List)

The “From List” version of the run Keyboard Maestro macro action lets you just select a macro from a drop down list of all of the available macros. The list supports filtering and as you type into the list of available macros it will reduce the list of matching macros making it quick to select it if you perhaps are not 100% sure on the name.

The action is storing and using the macro ID behind the scenes, so if you rename your macro, the action should continue to work, because the unique ID does not change.

You can optionally specify a string to be passed as input to the macro. There is no need to wrap the string(s) in quotes - the content will just be passed in; but your shortcut must be designed to make use of such input otherwise it will have no effect.

Examples

The following examples show the sorts of settings you might use with this action.

Run a Macro

Support

Support issues and queries such as bug reports, enhancement requests, and support questions are managed via an issue tracker hosted on GitHub. Currently open bugs are listed below. If you are experiencing an issue, but do not see it listed below, please create a new issue.