Press Button by Script

Hi all,

I am able now to press a button via a script.

The only problem is that I don't succeed to click the button I want.

In my example I create a box:

Box lengthsegs:1 widthsegs:1 heightsegs:1 length:20 width:30 height:15 mapcoords:on pos:[0,0,0] isSelected:on

and I run this code in order to hit the "Scale" button in the Motion panel:

(
   max motion mode
 
   maxHWND = windows.getMAXHWND()
   cmdHWND = for c in windows.getChildrenHWND #max where c[4] == "MotionTask" do exit with c[1]
 
   btnHWND = (windows.getChildHWND cmdHWND "Scale")[1]
   (
      UIAccessor.PressButton btnHWND -- press the button
   )
)
print cmdHWND
print btnHWND

The script works. It presses the the "Scale" button of the horizontal button bar of the PRS Parameters of the motion panel.

My problem:
I want to press another button that has the same name. It is the "Scale" Create Key button situated in the PRS Parameters of the motion panel as well.

Does anyone know how to access these Create Key buttons?

P.S. I know that I can easily create a scale key by using the corresponding maxscript command. I'm asking this as a general question on how to click a button in the 3DSMax GUI.
My real aim is the "Match IK and FK" button of the CAT motion panel parameters for which doesn't seem to exist a maxscript command.
But, as I know that there are a lot of guys who don't like dealing with CAT stuff I try to keep my question as general as possible. :)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ste's picture

Any solution?

So did you finally find a solution?

I have a similar problem with Interactive IK toggle...(http://www.scriptspot.com/forums/3ds-max/general-scripting/interactive-i...)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.