ScriptSpot

Forum topic · General Scripting

Press Button by script

By Ewok · 2012-04-16

Description

Hi,

I've a simple question.

I would like to simply press a button. But something is going wrong.
In my example I try to press the "Select and Move" button by using this line of code:

UIAccessor.PressButtonByName 67616 "Select and Move"

As you can see I used the:

Dialog Window Handle: 67616

But the MAXScriptListner shows a

false

message for it.
Does anybody know what is wrong?

Comments (5)

Same here

ste · 2013-10-29

As "Press Button by Script"... did you find a solution?

.

miauu · 2013-10-29

The solution is to use UIAccessors and DialogMonitorOps.

Yes I know...

ste · 2013-10-30

...but I'm quite a noob in scripting.

So i tried to adjust Ewok script (http://www.scriptspot.com/forums/3ds-max/general-scripting/press-button-…) to my needs.


(
   max hierarchy mode
 
   maxHWND = windows.getMAXHWND()
   cmdHWND = for a in windows.getChildrenHWND #max where a[4] == "HierarchyTask" do exit with a[1]
 
   btnHWND = (windows.getChildHWND cmdHWND "Interactive Ik")[1]
   (
      UIAccessor.PressButton btnHWND -- press the button
   )
)
print cmdHWND
print btnHWND

But there is someting wrong because I got no error, the listener returns "OK 66822P 66822P 198868P 198868P" and the command panel switch to hierarchy mode, but nothing else happened.

So where the problem is?

I also tried other solutions here
http://www.scriptspot.com/forums/3ds-max/general-scripting/interactive-i…
but with no luck...

why don't you just use max

jos · 2012-04-16

why don't you just use

max move

?

Hi Jos,it's just an example

Ewok · 2012-04-16

Hi Jos,

it's just an example to keep the topic as general as possible. :)

In reality I would like to press the "Match IK and FK" button of the CAT menu in the Motion panel. I would like to press this button because I can't find any command for it.