Jump to content
Sign in to follow this  
th3ownerer

Problem with script

Recommended Posts

th3ownerer

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
water

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
th3ownerer

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
th3ownerer

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
water

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
water

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.