I have created a Keyboard Maestro macro which outputs to the clipboard and a window the macOS version, the name of the front app and the version number of the front app. For example, for Curio:
macOS 11.2.2 - Curio, version 14.4
I use a macro provided Christopher Stone for getting the macOS version, and found through a search the following terminal command "mdls -name kMDItemVersion /Applications/" to get the version number.
The macro below works fine where the app consists of only one word.
But if the app consists of two words (such as "Keyboard Maestro" it fails). I understand in Terminal/Shell Script it is necessary to prepend spaces with an "\" and the macro adds the "\ " to any spaces in the app name.
For apps with two names, the command I create to run in the shell script works fine if I copy it run it manually in Terminal but not through the shell script command in Keyboard Maestro. For example the macro creates for Keyboard Maestro:
mdls -name kMDItemVersion /Applications/Keyboard\ Maestro.app
I would be grateful if I could have some help on how to amend my macro so that it can run if the app name has more than one word.