I should point out here that 'last' never refers to 'most recently created' and never has - it always refers to the last object of that type on the card. So, if your card has the structure:
Code: Select all
card
button
group A
button
group B
button
field
group C
Then, even if you create a group in group A then 'the last group' will still refer to group C. Of course, in this case 'the last group of group A' should give what you need.
I think the problem here is that some control creation commands *do not* return the long id 'it'; meaning that you can't easily access the control you just created and have to write more script to work out what the id of the object you just created was.