Yes. You can use a RegEx pattern for the Button Name, which will actually be your list of names.
Here's an example macro that works with TextEdit:
MACRO: Click on Any Button with Name in List [Example]
**Requires: KM 8.2.4+ macOS 10.11 (El Capitan)+**
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))
#### DOWNLOAD Macro File:
<a class="attachment" href="/uploads/default/original/3X/f/8/f80e3a76e831daa7009f98717ff0172cf55eb1d6.kmmacros">Click on Any Button with Name in List [Example].kmmacros</a>
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**
---
<img src="/uploads/default/original/3X/9/f/9f91356542cd7798b02790052f4aa38eb16cc424.png" width="580" height="696">
Does this work for you?