WarEagle Posted January 5, 2006 Share Posted January 5, 2006 Does the mouse movement while a script runs overide a user on the pc? I am using AutoIt to send mouse clicks to another application from Excel and I am wondering if those commands will work if I am using the mouse/keyboard when the script fires. If not, is there a way to run those commands in the background (i.e. a mouse click at a certain coordinate without actually moving the pointer on the screen)? I don't want to interfere with the script, but at the same time, I never know when the script will run, so I can't know when to NOT use the mouse). Thanks Link to comment Share on other sites More sharing options...
Sarc Posted January 5, 2006 Share Posted January 5, 2006 (edited) Does the mouse movement while a script runs overide a user on the pc?I am using AutoIt to send mouse clicks to another application from Excel and I am wondering if those commands will work if I am using the mouse/keyboard when the script fires. If not, is there a way to run those commands in the background (i.e. a mouse click at a certain coordinate without actually moving the pointer on the screen)? I don't want to interfere with the script, but at the same time, I never know when the script will run, so I can't know when to NOT use the mouse).Thanksthe program will continue to click etc at the assigned location on which ever window is on top, even if, as a user, you click on some other window you got open and give it the focus. the clicks will continue in whichever window has the focusi cannot give help as to the minimized clicking or w/e it is you need but i nkow its possible.. its just wether it works on A:I or not that baffles me~Sarcedit: sorry that came out wrong first time round Edited January 5, 2006 by Sarc Link to comment Share on other sites More sharing options...
herewasplato Posted January 5, 2006 Share Posted January 5, 2006 (edited) Does the mouse movement while a script runs overide a user on the pc?I would not say that one overrides the other. I would say that a user can interfere with the mouse movements that a script is attempting to achieve and that a script can interfere with the mouse movements that a user is attempting to achieve.If not, is there a way to run those commands in the background (i.e. a mouse click at a certain coordinate without actually moving the pointer on the screen)?ControlClick might do what you want, however there are at least two other options:1) You might be able do all that you need using COM. It can interact with Excel (and other apps) without a window showing.... but it is not something that I would suggest to a new user.2) Add a msgbox to your existing script asking if it is alright to run the script. Have the msgbox timeout incase there is no one at the keyboard when it comes up.the program will continue to click etc at the assigned location on which ever window is on top...Not if the script is written carefully. Never send a click without checking (or activating) the window of interest. Edited January 5, 2006 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
seandisanti Posted January 5, 2006 Share Posted January 5, 2006 Does the mouse movement while a script runs overide a user on the pc?I am using AutoIt to send mouse clicks to another application from Excel and I am wondering if those commands will work if I am using the mouse/keyboard when the script fires. If not, is there a way to run those commands in the background (i.e. a mouse click at a certain coordinate without actually moving the pointer on the screen)? I don't want to interfere with the script, but at the same time, I never know when the script will run, so I can't know when to NOT use the mouse).Thanksa user can fight with mousemove(), unless you use blockinput() to tie their hands first just a note if you're going to go that way though, make sure you reset w/ blockinput(0) when they can use the mouse again, also if your script locks up because of a wait condition that's never met, input will stay blocked. You can press control alt delete to set blockinput(0) if the script is hung and input is blocked. if you need a location clicked though, use either mouseclick() (with explicit coordinates) or controlclick() if you're clicking on a standard MS control. controlclick can click in non active windows, but mouseclick() just clicks in a specific location, regardless of what window is there. Link to comment Share on other sites More sharing options...
WarEagle Posted January 5, 2006 Author Share Posted January 5, 2006 ControlClick might do what you wantIf I understand it correctly, ControlClick allows you to focus on a button or whatever control and click on it, correct? My problem is that I am interacting with a Java application that does not allow focus of the button I need to press. (I trade currencies and I am trying to automate certain actions with the broker's order entry application, and for some reason they do not offer a hotkey to submit a trade, rather I must press the submit button). Since its not a windows based app, the standard control functions are not available to me (to my knowledge).1) You might be able do all that you need using COM. It can interact with Excel (and other apps) without a window showing.... but it is not something that I would suggest to a new user.I am using the COM from VBA within excel. But when I call a mouseclick, you can still see the pointer move to the window and click. If there is a way to do this without it showing on the screen then that would be awesome.I did not notice the BlockInput function, that may be what I need to use. I don't mind if the script overides what I am doing when it fires, since its only for a couple of seconds and doesn't occur very often.Thanks for the help everyone. I appreciate any and all suggestions. Link to comment Share on other sites More sharing options...
seandisanti Posted January 5, 2006 Share Posted January 5, 2006 If I understand it correctly, ControlClick allows you to focus on a button or whatever control and click on it, correct? My problem is that I am interacting with a Java application that does not allow focus of the button I need to press. (I trade currencies and I am trying to automate certain actions with the broker's order entry application, and for some reason they do not offer a hotkey to submit a trade, rather I must press the submit button). Since its not a windows based app, the standard control functions are not available to me (to my knowledge).I am using the COM from VBA within excel. But when I call a mouseclick, you can still see the pointer move to the window and click. If there is a way to do this without it showing on the screen then that would be awesome.I did not notice the BlockInput function, that may be what I need to use. I don't mind if the script overides what I am doing when it fires, since its only for a couple of seconds and doesn't occur very often.Thanks for the help everyone. I appreciate any and all suggestions.one thing that i suggest to everyone forced to interact with an applet is to get a decompiler (i personally use the DJ Java Decompiler freeware that i downloaded a few years ago off of cnet or download.com). With it you can get into the applet, and see exactly what it's doing, and quite possibly eliminate the need for the applet at all. I mean if you know what data the applet is using, and exactly what it's doing with the data, as far as where it's being sent, etc, there is no reason that you cannot re-create the exact same functionality with your own gui. Assuming you are allowed to reverse engineer the applet (or don't care) it usually doesn't take too long to convert code from one language to another, and alot of times java developers don't even obfuscate their code because they assume that once it's in byte code it's immune to tampering. Link to comment Share on other sites More sharing options...
herewasplato Posted January 6, 2006 Share Posted January 6, 2006 If I understand it correctly, ControlClick allows you to focus on a button or whatever control and click on it, correct? My problem is that I am interacting with a Java application that does not allow focus of the button I need to press. (I trade currencies and I am trying to automate certain actions with the broker's order entry application, and for some reason they do not offer a hotkey to submit a trade, rather I must press the submit button). Since its not a windows based app, the standard control functions are not available to me (to my knowledge).Sounds like you understand it right. ControlClick probably will not work for that app.I am using the COM from VBA within excel. But when I call a mouseclick, you can still see the pointer move to the window and click. If there is a way to do this without it showing on the screen then that would be awesome.From what I've read, you should be able to do most things within Excel without an Excel window showing (and no mouse moves needed).Search the forum for:+COM +Exceland you should get a few hundred returns...Here is a brief two:http://www.autoitscript.com/forum/index.ph...83entry132083http://www.autoitscript.com/forum/index.ph...169entry76169Or limit the search to:+COM +Excel +invisibleBTW, welcome to the forums! [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
WarEagle Posted January 6, 2006 Author Share Posted January 6, 2006 Thanks for the links, I will read through those threads. I am ok with Excel being visible, but what I would like is to have the mouse clicks in the java app to be invisible (or at least done where I can't interfere with it when its firing the macro). I am reworking some code and plan to test the BlockInput function.BTW, welcome to the forums!Thank you! Everyone has been very helpful here.Regards Link to comment Share on other sites More sharing options...
seandisanti Posted January 6, 2006 Share Posted January 6, 2006 Thanks for the links, I will read through those threads. I am ok with Excel being visible, but what I would like is to have the mouse clicks in the java app to be invisible (or at least done where I can't interfere with it when its firing the macro). I am reworking some code and plan to test the BlockInput function.Thank you! Everyone has been very helpful here.Regardsif you can PM me the java applet, i should be able to create a gui with standard controls that does the same thing, that way you can utilize the controlclick and controlsend functions to reduce the chances of human error. 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