I've tested your code to get the token name:
Code: Select all
[h:cond = "{}"]
[h:cond = json.set(cond,"layer",json.append("","OBJECT"))]
[r: rawList=listSort(getTokens(",",cond),"A")]
and it did work fine (I had placed one object on the OBJECT layer, and it's ID was displayed on the chat). As a general troublshooting step, if you think a specific function is not working as expected, remove the rest of the macro and set the suspected function to show some output (like I did "[r: rawList=listSort(getTokens(",",cond),"A")]")
So the problem does not come from getTokens(), but from the code you've placed afterwards. Maybe the objects you have placed do not have the Items property ?
Hope that helps.