[Maya] addToRecentCommandQueue & python

hi all,
I’ve been making a few scripts lately to make my life easier.
I am now looking for a way to enhance the workflow integration by adding the commands I am using from the UI of those scripts to the last command queue to be able to use the RepeatLast hotkey.

where I am stuck is how to use the addToRecentCommandQueue hidden command with python. There seem to be no documentation about it.
I am hoping I can avoid having to wrap it with a mel eval.
I would appreciate if anyone had some info on this.
thanks.

Running a MEL “whatIs addToRecentCommandQueue”, I can see it comes from initAuxiliary.mel in scripts/startup.

Opening it up, it looks like just a wrapper command for “repeatLast” command. So something like this should work(?):

def Test():
print ‘a’
maya.cmds.repeatLast(ac=Test, acl=“Run My Test”)

Thanks :slight_smile:

google failed me, and I didn’t thought of using whatIs :x:
for those interested, it seems repeatLast also is undocumentated both for mel and python.

help repeatLast;
// Result:

Synopsis: repeatLast [flags]
Flags:
-e -edit
-q -query
-ac -addCommand String
-acl -addCommandLabel String
-cl -commandList Int
-cnl -commandNameList Int
-hl -historyLimit Int
-i -item Int
-nhi -numberOfHistoryItems

Command Type: Command
//

I’ll have to try and see if I can get this working with python.