Sign in to follow this  
Followers 0
th3ownerer

Problem with script

10 posts in this topic

HI.

I am new to Autoit and just want to make a simple script which switches to a program and then clicks a button every 15 minutes

Please can anyone help me

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Please have a look at Winactivate, WinWaitActive, Sleep and ControlClick.

To get the ControlId of the button please use the AutoIT tool WindowInfo.

Something like:

HotKeySet("+!q", "Quit")    ; HotKey to end the script Ctrl+Alt+Q
WinActivate("Here goes the Window title")
WinWaitActive()
While 1
 Sleep(900000)
 ControlClick("Here goes the Window title","",ControlId)
Wend

Func Quit()
 Exit 0
EndFunc
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

does wait win active force the computer to go to that window??

also i need to click a button in the browser not a windows button so I'll need like a OCR or something and then make it read the button

Edited by th3ownerer

Share this post


Link to post
Share on other sites

and thanks for the help till now

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

or i could wait for the windows to become active after about 15 mins and then press enter

how could i do this???

Edited by th3ownerer

Share this post


Link to post
Share on other sites

does wait win active force the computer to go to that window??

WinActivate activates the Window

WinWaitActive just makes sure the Window is active before doing any actions with the window.

also i need to click a button in the browser not a windows button

There is an UDF available to handle all kind of IE things (please see the help file: User Defined Functions -> IE Management).

What function to use depends on the type of link/button/image you want to click. Please see _IELinkClickByIndex or _IELinkClickByText


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

i use firefox

Share this post


Link to post
Share on other sites

Even worse :)

There is an UDF for FF as well.

As I 've never worked with AutoIT and FF my expertise (if any) ends here.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

ummm how to loop this

Share this post


Link to post
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
Sign in to follow this  
Followers 0