zapperzme Posted June 6, 2010 Share Posted June 6, 2010 (edited) Hello, I have an issue that maybe someone else came across, but managed to fix it themselves.. Part of the AutoIt program I made involves opening a new Internet Explorer window; the keyboard command for that is CTRL+N, So that would mean using Send("^n") correct? My problem is that from 3 Send commands only 2 are processed by the browser. Having one page opened, when I'm using Send 3 times, I should have 4 pages.. only 3 are opened. Well here is the exact portion of the script: Sleep(5000) WinSetState("", "", @SW_RESTORE) Sleep(5000) Send("^n") Sleep(5000) Send("^n") Sleep(5000) Send("^n") Sleep(5000) The Restore is just to restore from Maximize state, I was thinking that maybe the page takes too long to load, and somehow the script is blocked, but also I tried giving my program higher priority on a process level. As you can see there is nothing.. complicated that needs to be done, I even set some exagerated delays (Sleep(5000)) . The machine on which the program doesn't work right is a i7 processor 8 cores, memory i don't think is that much of importance, neither the rest of the components as I'm thinking only the processing power is the problem. The environment it needs to work on is a Remote Desktop Session on win server 2008 set up as remote desktop server. Why I mentioned that I'm thinking the processing power is to blame is that running my program on a virtual machine limited to 1 max 2 cores has no problems.. not to mention the Delays by Sleep are different from running on the win server(Sleep last a lot less on the 8 core machine). Now besides what I tried to do above, with a lot more sleep, was to make Send different, but I'm lacking the information here... I tried to do Send("{^ down}") Send("n") Send("{^ up}") Only it didn't do anything.. so clearly that's not the way to do it .. If anyone has any ideas how I could get Send, to either be sent "slower" or to first hold ctrl , send "n" and release after... Using Multiple Virtual machines limited to 2 cores is not that much of an option, I was on this setup until now. By using Windows remote desktop server I can double the number of "machines" - in this case there would be users, remote desktop sessions. Edited June 6, 2010 by zapperzme Link to comment Share on other sites More sharing options...
Zibit Posted June 6, 2010 Share Posted June 6, 2010 its more like: Send("{down}") Send("n") Send("{up}") Creator Of Xtreme DevelopersPixel Pattern UDFTray GUI UDFMathssend & recive register scriptMouse Control via Webcam Link to comment Share on other sites More sharing options...
zapperzme Posted June 6, 2010 Author Share Posted June 6, 2010 And how is Send() suppose to know which key to hold down?... for me I need "^" key to be held down..."^" means CTRL Link to comment Share on other sites More sharing options...
zapperzme Posted June 6, 2010 Author Share Posted June 6, 2010 I didn't read the Help file properly it seams.. Opt("SendKeyDownDelay", 1) SendKeyDownDelay Alters the length of time a key is held down before being released during a keystroke. For applications that take a while to register keypresses (and many games) you may need to raise this value from the default. A value of 0 removes the delay completely. Time in milliseconds to pause (default=5). I underestimated the Help file of AutoIt.. Thanks Zibit. But most of all Thank you all AutoIt Devs. 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