MaxGom Posted March 20, 2015 Share Posted March 20, 2015 Hi there! I am a noob to AutoIt and just starting to familiarize myself to scripting with it. Before this I have been using GUI Macro to automate my task. So, recently I have been trying to move the mouse pointers and made clicks on the desktop. I activated a program window specially designed to do inventory correction. There was a blank to be filled in with certain information. I scripted something out of AutoIt, and made it to move the mouse pointer and made a right mouse click on the blank field. It should display some context menu. But nothing happened, although it managed to move the mouse pointer where I wanted it to. Automating my task this way has been very helpful to me. I have over 4000+ entries to correct and enter and doing this manually would kill my fingers. Honestly, I have tried many other macro recorders to do the task but none seems to work. They do work outside the mentioned windows however, but not in it. I read somewhere that, some task automation software cannot work in some circumstances eg gaming as it doesn't interact via the mouse and keyboard drivers directly.Could it be the same in this case that the inventory program is designed in such a way? Is there a way to go about this? Please, I need help. Thank you in advance. Link to comment Share on other sites More sharing options...
MaxGom Posted March 20, 2015 Author Share Posted March 20, 2015 I noticed that, as soon as I activated the inventory window, the script stopped working. The mouse won't move. Link to comment Share on other sites More sharing options...
mlewis412 Posted March 20, 2015 Share Posted March 20, 2015 (edited) Maybe you can use something like this? Winactive("Your Program Title Goes Here") Sleep (10000) While(1) Send ("y") ;Sends Key Stroke Sleep (500) MouseClick ('left', 639,318) ;Sends Left Mouse Click to quadrant on screen Sleep (500) MouseClick ('right', 356,326) ;Sends Right Mouse Click to quadrant on Screen WEnd Edited March 20, 2015 by mlewis412 Link to comment Share on other sites More sharing options...
MaxGom Posted March 20, 2015 Author Share Posted March 20, 2015 Wow. I've never expected any reply to be this fast. Thanks. This is what I have: WinActivate("BMS Troubleshooting Tool") MouseClick ( "right" , 1193, 80 , 1 , 10 ) As soon as the WinActivate BMS Troubleshooting Tool is activated, the next line of the script is not executed. It just stops there. No movement of the mouse, no clicking, nothing. However, this worked on any part of the screen, except on particular BMS window. Any way to get around this? Link to comment Share on other sites More sharing options...
Marss Posted March 20, 2015 Share Posted March 20, 2015 Have you tried something like WinActivate("BMS Troubleshooting Tool") WinWaitActive("BMS Troubleshooting Tool") MouseClick("right",1193,80,1) or see if you need to use a delay: WinActivate("BMS Troubleshooting Tool") WinWaitActive("BMS Troubleshooting Tool") Sleep(3000) MouseClick("right",1193,80,1) Link to comment Share on other sites More sharing options...
MaxGom Posted March 22, 2015 Author Share Posted March 22, 2015 Thanks Marss for the reply. Will try to insert the 'Sleep' command later. I am wondering whether AutoIt uses the mouse/keyboard drivers to deliver clicks, send keys or move the mouse. Link to comment Share on other sites More sharing options...
Solution MaxGom Posted March 23, 2015 Author Solution Share Posted March 23, 2015 I have finally found the solution to my problem. It turns out that, if a program, in this case the BMS Troubleshooting tool program, has a different administrator privilege than AutoIt, any mouse clicks and send keys command from AutoIt to control the BMS window simply won't work. I gave the BMS program the same administrator privilege as AutoIt and that worked well. Anyway, I thank all those who have helped me here and thank you for your patience as well. I think we can consider this thread as close. Luv ya. Nas 1 Link to comment Share on other sites More sharing options...
PR0J1019 Posted May 27, 2020 Share Posted May 27, 2020 MaxGom, Thank you for your solution. You saved me hours of my life. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now