ScriptSpot

Forum topic · General Scripting

how to "clic" a opened window button ?

By titane357 · 2015-12-28

Description

Hi
I want to automate some actions, and I would like to "clic" on a opened window button.
I look at "dialogMonitorOps",and "UIAccessor" is it a solution ?

Comments (3)

.

miauu · 2015-12-28

If the window is not created by you or you can't read the code that creates the window then use "dialogMonitorOps" and "UIAccessor".
If the window is created by you or you can read the code of the script then you can click the desired button directly. For example:



(
 global myRollout
 rollout myRollout "My Roll"
 (
  button btn_01 "Press me"

  on btn_01 pressed do
  (
    print "I was pressed"
  )
 )
 createDialog myRollout
)

To press the btn_01 from any other code(script) use this:


myRollout.btn_01.pressed()

titane357 · 2015-12-29

Thanks for answer, hope you're on hollidays.

.

miauu · 2015-12-29

At work unfortunately. On January 1 also - 24h shift. :)