Have you tried @DanThomas’ macro?
MACRO: Get Selected Macro UUID (and name) (without the clipboard)
For more information, see the wiki Searching the Forum for Answers section.