Skip to content
Home

General concepts

Action types

Each of UIA's actions belongs to one of four categories:

  • Lookups (Get Windows, Get App, etc.) will only return one/many objects, but they'll never do anything with them.
  • Filters accept lists of objects of a type, and return a subset of the input.
  • Tests accept one or more objects, check them for a predicate, and return a YES/NO result. For example: Is this window …? (… minimized, etc.)
  • Performers only do something. They'll accept one or more objects where necessary (e.g., Minimize Window needs a window reference to work with), but they also might not (e.g., when simulating key presses).

In some rare cases an action might do more than one thing, for convenience's sake. For example, Select Menu Item allows you to specify the menu item's title, which means it combines lookup and performer – it just makes sense there.

Usually, I'll try to avoid that, though. 😉

Objects & return values

Many UIA Shortcuts actions return objects which aren't simple YES/NO, string, or number values – they contain certain properties about themselves as key-value pairs. Each of those objects represents a "thing" in macOS:

For example, the Get App action will return a Running App object that contains the list of the app's windows, or whether the app is currently frontmost.

Screenshot of the Shortcuts editor, showing the 'Get App' action result's properties overlay

Also, many window-related actions return Window objects that contain infos about the underlying window, such as min/max state, the type of window it is (floating or standard), its size etc.

Screenshot of the Shortcuts editor, showing the 'Get Window' action result's properties overlay

Several actions accept these objects as input, e.g., Minimize Window or Select Menu Item. This way, you can chain actions together to create more complex workflows.