Jump to content

Automatic Button Click - (Moved)


DWoods
 Share

Recommended Posts

I am wanting to create a script that once running it will continue to run until forcibly stopped or the server is restarted.

where it will look for particular dialog boxes that contain specific text and select the option of Yes each time.

I am new to using AutoIT and been trying to get my head round how everything works so if a script is available already that would be perfect.

auto_it.png

Link to comment
Share on other sites

  • Developers

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

There is certainly an already written script that is performing what you want, but you will need to search for it.

But since it is quite an easy script to write, I would suggest you take a look at WinExists using special definition [CLASS:#32770].  If you find one then ControlSend a "^y" to it.  Loop forever with a small Sleep(100) to give some air to the CPU.

Link to comment
Share on other sites

I have searched for scripts that have already been made and have found very little, from what I have found I have put together something but it is not working at all. here is the script I have so far.

$Title = "Lexis Visualfiles (Press HELP to view stack trace)"

If WinExists("[TITLE:$Title; CLASS:#32770;]") Then
ControlClick("[CLASS:Button; INSTANCE:1; "^y"]")
EndIf
While 1
Sleep(100)
Wend

Any help at all would be perfect, and I will apologies in advance if I do not understand aspects that provided in comments, I am a novice to autoit so trying to learn bits as I go along and from what I read.

Link to comment
Share on other sites

I'll give you a hand on this, try :

Opt ("MustDeclareVars", 1)

HotKeySet ("{ESC}", _Exit)
Const $sTitle = "Lexis Visualfiles (Press HELP to view stack trace)"

While True
  If WinExists("[TITLE:$sTitle; CLASS:#32770]") Then
    ControlSend("[TITLE:$sTitle; CLASS:#32770]", "", "", "!y")
  EndIf
  Sleep(100)
Wend

Func _Exit ()
  Exit
EndFunc

Made I dyslexic typo, it should be "!y" (alt-y) instead of "^y" (ctrl-y).  Read carefully help file about those functions that I used.

If you still have problem, try practicing with an app that I can run (e.g. Notepad or Paint).

And please use this tool, when you post code.

Edited by Nine
Link to comment
Share on other sites

1 hour ago, Nine said:

I'll give you a hand on this, try :

Made I dyslexic typo, it should be "!y" (alt-y) instead of "^y" (ctrl-y).  Read carefully help file about those functions that I used.

If you still have problem, try practicing with an app that I can run (e.g. Notepad or Paint).

And please use this tool, when you post code.

Thanks for this, I will give it a try and update you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...