Application menu options at given menu path (subroutine)

A subroutine for finding the options available in an application at a given menu path (perhaps, for example, getting a listing of MRU (most recently used) files.

An example of the macro's use below.

(@peternlewis does something much faster and more magical (a bit mysterious to me) in the GUI of the Select Menu action, but this subroutine just uses osascript – serviceable but not snappy)

Application Menu options at given path Macros.kmmacros (15 KB)