Why I Can't Repeat My Script's Button Action By Pressing G

To repeat some action in maya you press g.

Well in my script i have a button that does something(does not matter) and the g stuff does not work...

Any way to fix this or it is just the way it is?

button functions do not count as repeatable actions (thankfully!) but you can actually modify the repeatLast stack yourself using the repeatLast command.

just make your script that your button executes make a call to the "repeatLast" command.

This way you can make the "g" key repeat exactly what you want.

:nathaN

or you use a shelfButton. That does this automatically :]

I added repeatLast at the and of my procedure;

But it is still the same.After executing my button's action, and then when i try to do it again with G it does not execute the proc again.

Any ideas?

you can't just use "repeatLast" and expect it to know what to repeat, you have to specify excactly what you want to happen, this is what I meant before when I said "This way you can make the "g" key repeat exactly what you want".

CODE
repeatLast -addCommand "makeGrass(1,0)" -addCommandLabel "Make Some Grass";

:nathaN