cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

Auto Click Button

nguyendangkhoa
Level I

Hi Guys,

How I can auto click button "OK" after I choose variable , because after this dialog I have to run another chart and data

You can see in below pictures 

nguyendangkhoa_0-1584699393718.png

 

4 REPLIES 4
cwillden
Super User (Alumni)


Re: Auto Click Button

Can you elaborate on under which conditions you would want to automatically click "OK"?  In JSL, you can programatically click a button using something like "OK_button << click;"

 

If, for example, you want to programatically click OK once all required inputs are populated, you could write a function or expression like this:

check_inputs = Expr(
	If(
		N Items( y_inputs << get items ) > 0 & N Items( x_inputs << get items ) > 0
		 & N Items( parts_inputs << get items ) > 0,
		OK_button << click
	)
);

Then, within  the script for each of the input buttons, you could add check_inputs() at the end.

 

-- Cameron Willden


Re: Auto Click Button

Thank you so much, I will try it on my script

TDF
TDF
Level II


Re: Auto Click Button

How can you find out what the button is called?

I have a similar issue with the GO button needing to be automatically pressed.

I've guessed (presumably incorrectly) at what it might be called but those combos GO_button, etc. did not work.


Re: Auto Click Button

The previous example uses a variable GO-button in which a reference to an actual button was previously stored. See the example below for the basic approach to use.

 

Names Default to Here( 1 );

// example data set
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// example dialog
launch = dt << Fit Model(
	Y( :weight ),
	Effects( :age, :sex, :height ),
	Personality( "Standard Least Squares" )
);

// find Run button and unwrap the list
button = (launch << XPath( "//ButtonBox[text()='Run']" ))[1];

// click it!
button << Click;