Jump to content

Don't understand why can't send("{KEYS}")


Recommended Posts

Hello, 
 
So I have a little program that I'm writing to automate some installations. I have successfully written a file that can do Adobe Reader, but now I'm on to RealPlayer.
 
My issue comes up near the end. After the program installs, a window pops up asking the user if he/she would like to upgrade to RealPlayer 16 Plus. I do not want to and would like to close that window. 
 
Here is my code:

Run("RealPlayer.exe")
WinWaitActive("RealPlayer Install Wizard", "END USER LICENSE AGREEMENT")
Send("{ENTER}")
Send("{TAB}{TAB}{TAB}{SPACE}{TAB}{TAB}{TAB}{TAB}{ENTER}")
Sleep(40000)
Send("{TAB}{TAB}{TAB}{ENTER}")
MsgBox(0, "Close", "Should be closed")
ProcessClose("RealPlayer.exe")

The command after the Sleep(40000) aren't working. The message box pops up, but the "SEND" command doesn't seem to be doing anything. Any thoughts or ideas would be most appreciated.

Thanks

Edited by jgriner0918
Link to comment
Share on other sites

Hi jgriner0918,

  and welcome to the forum!

Almost all (if not all) active windows can be closed with ALT + F4

no silent installer available...?

Edit: P.S. there are other more reliable ways to interact with windows using AutoIt.

using the window info tool that comes with it and getting detailed info about the windows controls and then using ControlSend ControlClick etc...

Bill

Edited by l3ill
Link to comment
Share on other sites

can you try putting #requireadmin on top of the line and see if that helps?

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")
Link to comment
Share on other sites

Thanks guys, but I'm still stuck. The Alt+F4 trick didn't work. I have RequireAdmin at the top of the file. When I use the AutoIt Window Info program, the window that is giving me trouble has a generic title and no text, hidden or visible. :(

I put a MsgBox in there to give me a breakpoint. If I actually click into the window and do the Alt F4, then it works, or if I click into the window then use the TABS, then it'll work. But somehow, when I try to do it automatically, it doesn't work. 

Edited by jgriner0918
Link to comment
Share on other sites

Just an FYI, you do realize that your sleep is set to 40 seconds?

You will have to find a way to interact with that window when it actually has focus and then use the ALT F4 (at least now you know it works)

It just has to be active when you send the command.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...