Macros; Null on AutomatonMacroAPI.getModelData()

Using 2021x, groovy. I've seen some other examples of people using it. But it just returns null everytime for me. 

 

Also, I would like to organize Reference properties (owned by a block) by name, programmatically. I can access the node via 
def childArrayList = Application.getInstance().getProject().getBrowser().getActiveTree().getSelectedNode().getChildren();   
 

But I am seeing no way to actually manipulate them. I assume the node sortkeys are some kind of internal thing for auto sort. I could go into the spec under inner elements,but A-Z button is always greyed out. So I have to manually sort them, and there are a lot. Thoughts?