terrence Posted December 29, 2005 Share Posted December 29, 2005 Can some one help me with sending the command for pressing the Alt/TAB keys. I've tried using: Send("!TAB"), but it doesn't appear to be working. Thanks! Link to comment Share on other sites More sharing options...
MHz Posted December 29, 2005 Share Posted December 29, 2005 Your missing the curly brackets.Send('!{TAB}')The correct syntax is in the AutoIt helpfile Link to comment Share on other sites More sharing options...
terrence Posted December 29, 2005 Author Share Posted December 29, 2005 Your missing the curly brackets. Send('!{TAB}') The correct syntax is in the AutoIt helpfileThank, but I tried it that way too, and no go. Link to comment Share on other sites More sharing options...
MHz Posted December 29, 2005 Share Posted December 29, 2005 Try this then. I seem to getting the window selection window when used with either. Send('{ALT DOWN}{TAB}{ALT UP}') This will hold down the Alt key, press Tab, then release the Alt key. Link to comment Share on other sites More sharing options...
terrence Posted December 29, 2005 Author Share Posted December 29, 2005 Try this then. I seem to getting the window selection window when used with either. Send('{ALT DOWN}{TAB}{ALT UP}') This will hold down the Alt key, press Tab, then release the Alt key.Still no go for me. I'm trying to write an auto script for Adobe Writer, and it dies at this point when it needs to go back to the install screen. Link to comment Share on other sites More sharing options...
MHz Posted December 29, 2005 Share Posted December 29, 2005 Perhaps you may want to show some code to display what you are doing ? If you just want to switch between active windows then the WinActivate() function may do what you want or even the Control*() functions work with inactive window controls so switching active windows is not neccesary. Link to comment Share on other sites More sharing options...
herewasplato Posted December 29, 2005 Share Posted December 29, 2005 (edited) Try this then. I seem to getting the window selection window when used with either. Send('{ALT DOWN}{TAB}{ALT UP}') This will hold down the Alt key, press Tab, then release the Alt key.Perhaps something has changed in AutoIt Beta... ...but shouldn't ALT DOWN be ALTDOWN (w/o a space)? @terrence, Does alt-tab work for you during a manual install? Seems rather odd to have to do that during a normal install. Edit: format, spell'n Edited December 29, 2005 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
terrence Posted December 29, 2005 Author Share Posted December 29, 2005 Perhaps something has change in AutoIt Beta......but shouldn't ALT DOWN be ALTDOWN (w/o a space)?@terrence,Does alt-tab work for you during a manual install?Seems rather odd to have to do that during a normal install.Edit: formatYes, Aty/TAB works manually. Here's the code:Run( "Install.exe" )WinWait("InstallShield")Send("!y");WinWaitActive("Setup");Send('{ALT DOWN}{TAB}{ALT UP}');Send("!n");WinActivate("Software License Agreement")Send("!y");WinWaitActive("User Information")Send("{TAB}");Send("{TAB}");Send("AOW301R7100012-888-760");Send("!n");Send("!y");WinWaitActive("Install Icons");Send("{SPACE}");Send("{TAB}");Send("{ENTER}");Send("{ENTER}");Exit Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted December 29, 2005 Moderators Share Posted December 29, 2005 Try this: Run( "Install.exe" ) WinWait("InstallShield") Send("!y") WinWaitActive("Setup") Send('{ALTDOWN}{TAB}{ALTUP}') Send("!n") WinActivate("Software License Agreement") Send("!y") WinWaitActive("User Information") Send("{TAB 2}") Send("AOW301R7100012-888-760") Send("!n") Send("!y") WinWaitActive("Install Icons") Send("{SPACE}") Send("{TAB}") Send("{ENTER 2}") Exit Also you should try to use ControlClick() and ControlSend() rather than tabbing to the control and sending text to it. It's just more fail safe, and if a user clicks a button it won't mess it up. Link to comment Share on other sites More sharing options...
terrence Posted December 29, 2005 Author Share Posted December 29, 2005 Try this: Run( "Install.exe" ) WinWait("InstallShield") Send("!y") WinWaitActive("Setup") Send('{ALTDOWN}{TAB}{ALTUP}') Send("!n") WinActivate("Software License Agreement") Send("!y") WinWaitActive("User Information") Send("{TAB 2}") Send("AOW301R7100012-888-760") Send("!n") Send("!y") WinWaitActive("Install Icons") Send("{SPACE}") Send("{TAB}") Send("{ENTER 2}") Exit Also you should try to use ControlClick() and ControlSend() rather than tabbing to the control and sending text to it. It's just more fail safe, and if a user clicks a button it won't mess it up. Thx, but it still does not toggle back to the install screen. Link to comment Share on other sites More sharing options...
herewasplato Posted December 29, 2005 Share Posted December 29, 2005 Thx, but it still does not toggle back to the install screen.Does the "install screen" have a window title that you can use WinActivate with? (like MHz suggested)If you exit your script after this line:Send('{ALTDOWN}{TAB}{ALTUP}')ExitDoes the window toggle back as desired?If not, sprinkle some sleep lines around while you debug this. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 29, 2005 Moderators Share Posted December 29, 2005 If not, sprinkle some sleep lines around while you debug this.Ha!, I had thought of cookies (the kind you eat ) when I read that!!Torrence, it was suggested that if your windows and buttons have ControlID's that ControlClicks() may be what your looking for. I'm inclined to agree with that, as it will leave less room for error this way.You'll also find a smoother transition this way IMHO. Do you know if AutoInfo shows these for each window (Control ID's That is)? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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