Additional considerations

In building the Calculator project, we have covered the fundamentals of creating a Flexi-deck project based on basic consideration of the task to be automated and using the editors to create the required menus and macro to implement the automation.

However, there are other considerations when creating either more complex projects or creating a project for distribution that may run on different releases of both the application and operating systems.

To this end, we now explore what additional processing might be needed to allow the calculator project to work on different versions of the app between macOS 14 and 15.

The Calculator project was originally created in macOS 15 and some of the macros did not function as expected in macOS 14.

The issues were threefold:

  1. Between macOS 14 and 15, the Calculator app has different menus. Most importantly, the File menu is removed, meaning if Flexi-deck looks for the menu purely by position (which is the case by default), it'll get the wrong one when switching between macOS 14 and 15.

  2. In macOS 15, Apple has inserted invisible blank menu items into menus that only show up when examining them with the Accessibility API and throw off the ordering of menu items. So if Flexi-deck looks for a menu item purely by position, it gets it wrong when switching between macOS 14 and 15.

  3. In macOS 14, the menu item is "Show Thousands Separators" and picking it adds a check mark. In macOS 15, it's "Show Thousands Separator" (note the lack of 's' at the end) and switches to "Hide Thousands Separator" when you pick it, rather than using a check mark.

In order to cater for the above, there are a number of changes needed with the "Pick menu item" action:

  1. Starting in macOS 15, we need to switch the target UI element to custom matching to be more specific about how to find it. To do this, you need to invoke the Advanced UI element setting:

  2. Pick the last element in its UI element hierarchy (the actual menu item) and deselected "Sibling order" and then selected "Title" so that it'll find the element by its title:

  3. Now right click the "Title" line, select Edit, and add "Hide Thousands Separator" from the Calculator View menu. With both Show and Hide in the list, select them individually and click "Find translations for selected item" This will allow the menu items to be found regardless of the system language:

  4. Now, in macOS 14, use the Advanced UI Element Settings to edit the action and add another UI element this time the "Show Thousands Separators" element, so that it'll work in macOS 14 as well. Now perform the same routine in 2 and 3 above, setting custom matching, deselecting "sibling index", and adding all the translations of "Show Thousands Separators" so that it'll find the menu item by its title, not its position.

The above is something of a case study of what's necessary to get FD macros working across multiple versions of an app or macOS, when the UI elements change around or aren't consistent. It's tricky!

Unfortunately, there is no generic solution. It just requires a basic understanding how Flexi-deck looks for UI elements and using some problem-solving to get it to consistently pick the right one in all the situations needed.

It often means not using "default matching", since with that, Flexi-deck takes its best shot at finding the right UI element and is very permissive with what it considers a match.

This basic mode caters for macro running a a defined system or OS where the UI is unlikely to change around.

"Default matching" can work when distributing a macro to others, but it's more likely to go wrong due to subtle (or not so subtle) changes in the UI that are sure to happen between different versions of an app or macOS.

Last updated