draconis Posted March 2, 2011 Share Posted March 2, 2011 Hi,I'm trying to create a script to tab between open windows inside visual studio 2010.This is what I came up with:for $i=1 to 1000 Send("^{TAB}") ; Sleep( 10000);NextThis works fine in, say, Chrome or Firefox, but not in Visual Studio. I tried to understand why, and I saw that the actual key sequence is slightly different:press and hold ControlClick on Tabrelease ControlCan anybody give me a hand with this? Thanks. Link to comment Share on other sites More sharing options...
jvanegmond Posted March 2, 2011 Share Posted March 2, 2011 (edited) Hi,I'm trying to create a script to tab between open windows inside visual studio 2010.This is what I came up with:for $i=1 to 1000 Send("^{TAB}") ; Sleep( 10000);NextThis works fine in, say, Chrome or Firefox, but not in Visual Studio. I tried to understand why, and I saw that the actual key sequence is slightly different:press and hold ControlClick on Tabrelease ControlCan anybody give me a hand with this? Thanks.That's exactly what ^{TAB} does. Have you tried pressing Ctrl and releasing it then pressing Tab and releasing it to verify that this is indeed your issue? I am in Chrome right now and it doesn't work at all. Maybe your Chrome is different from mine. Let's assume that it is not. If that is not your problem, what demonic magic is causing your script not to work on VS2010? It appears that sometimes the keys are not being handled by VS2010, even though they are there being pressed ... But wait, when I press Ctrl+Tab that window that shows the open tabs appears. My human fingers are probably very slow compared to the script which can send key presses like that in an instant. Well, if that is the case I have to somehow make the keys be pressed longer. Now I could make a thread about that on the forum, but I could also check the help file. And, as thunderbolt in bright daylight, there it was: http://www.autoitscript.com/autoit3/docs/functions/AutoItSetOption.htm#SendKeyDownDelaySorry for the long post, my work day is almost over and I needed something to do. Edited March 2, 2011 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
draconis Posted March 2, 2011 Author Share Posted March 2, 2011 That's exactly what ^{TAB} does. Have you tried pressing Ctrl and releasing it then pressing Tab and releasing it to verify that this is indeed your issue? I am in Chrome right now and it doesn't work at all. Maybe your Chrome is different from mine. Let's assume that it is not. If that is not your problem, what demonic magic is causing your script not to work on VS2010? It appears that sometimes the keys are not being handled by VS2010, even though they are there being pressed ... But wait, when I press Ctrl+Tab that window that shows the open tabs appears. My human fingers are probably very slow compared to the script which can send key presses like that in an instant. Well, if that is the case I have to somehow make the keys be pressed longer. Now I could make a thread about that on the forum, but I could also check the help file. And, as thunderbolt in bright daylight, there it was: http://www.autoitscript.com/autoit3/docs/functions/AutoItSetOption.htm#SendKeyDownDelaySorry for the long post, my work day is almost over and I needed something to do.I did consult the help file and have tried this already, although I'm not sure I handled the option correctly.Here is the other version I have been using (also doesn't work):for $i=1 to 1000 Opt("SendKeyDownDelay", 100); Send("^{TAB}") ; Sleep( 1000);Next Link to comment Share on other sites More sharing options...
jvanegmond Posted March 2, 2011 Share Posted March 2, 2011 I did consult the help file and have tried this already, although I'm not sure I handled the option correctly. Here is the other version I have been using (also doesn't work): for $i=1 to 1000 Opt("SendKeyDownDelay", 100); Send("^{TAB}") ; Sleep( 1000); Next Opt("SendKeyDownDelay", 1000); for $i=1 to 1000 Send("^{TAB}") ; Sleep( 1000); Next Would be correct. And it works for me brilliantly. github.com/jvanegmond Link to comment Share on other sites More sharing options...
draconis Posted March 2, 2011 Author Share Posted March 2, 2011 (edited) Sorry, still not working. Works everywhere *except* VS 2010. Maybe related to the fact that when you press this key combination in VS, a small window opens up during the transition? Edited March 2, 2011 by draconis Link to comment Share on other sites More sharing options...
jvanegmond Posted March 2, 2011 Share Posted March 2, 2011 Everything works for me. The script runs, I open VS2010, the little tab window that you mentioned appears for almost a full second, then I see another tab. I'm very much suspecting that something else is going on on your end: You're not running the script as it is presented in this thread, or you have addons in VS2010 that are messing things up. I reinstalled my PC with Windows 7 last Saturday and the only thing I installed on it is VS2010 and AutoIt and it works: So, proof enough that it works on a default install. github.com/jvanegmond 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