Toolbox menu selection by CEP .jsx script

Hi, does anyone have idea to select the toolbox menu by scripting?
I want the rectangle menu in the toolbox to be selected (like the img.) After that users will be able to start drawing rectangle of prescribed fillcolor settings. Therefore, generating a rectangle of pre-set shape cannot be a solution - I want users to draw it freely.
I think these ideas are candidate but cannot achive it yet.
Idea 1: Any jsx function to select this menu? , or,
Idea 2: Any way to dispatch "M" key to the application window as the shortcut key of the rectangle menu? (not to CEP extention window)
I'm glad if you could share any ideas or experiences. Thanks in advance.
