... Another version of the same script:
import xml.etree.ElementTree as ET
tree = ET.parse('voicecommands.xml')
root = tree.getroot()
def getGroups():
vc.callAction('OSD.ShowText','Command Groups:&&8000&&-10',None)
vc.callAction('PayloadXML.Clear','payloads\\vcGroups.xml',None)
groups =root.findall("./*[@enabled='True']")
for group in groups:
idx = groups.index(group)+1
name = group.get('name')
vc.callAction('OSD.AddText',str(idx)+'. '+name,None)
vc.callAction('TTS.Speak',name,None)
vc.callAction('PayloadXML.AddPair','payloads\\vcGroups.xml&&%s&&%s, group %d&&True'%(name,name,idx),None)