Jump to content

Simple Command


terrence
 Share

Recommended Posts

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

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

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 by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

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: format

Yes, 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

  • Moderators

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

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

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}')

Exit

Does 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

  • Moderators

If not, sprinkle some sleep lines around while you debug this.

Ha!, I had thought of cookies (the kind you eat :P ) 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

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...