Jump to content

Newbie question


 Share

Recommended Posts

This will probably make you lough, but I cannot see what is wrong with this script:

RunWait ("L:\saplogon.exe")

WinActivate ("Archivio auto-estraente WinRAR")

If WinActive("Archivio auto-estraente WinRAR") Then

MsgBox(0, "", "La finestra è attiva")

EndIf

Send ("!i")

Send ("!t")

RunWait ("msiexec SAPSSO.msi", "L:")

Send ("{ALT}e")

Send ("{ALT}f")

I always get to the program window, but it stops without receiving the ALT+i signal and hangs there. What am I missing?

Thanks a lot

Link to comment
Share on other sites

Have you tried without the message box?

Or reactivate the window after the message box?

sometimes it is good to put some sleep statments in as well.

RunWait ("L:\saplogon.exe")
WinActivate ("Archivio auto-estraente WinRAR")
If WinActive("Archivio auto-estraente WinRAR") Then
MsgBox(0, "", "La finestra è attiva")
EndIf
WinActivate ("Archivio auto-estraente WinRAR")
sleep(250)
Send ("!i")
sleep(250)
Send ("!t")
RunWait ("msiexec SAPSSO.msi", "L:")
Send ("{ALT}e")
Send ("{ALT}f")

You may also check Winrar as you can compress with options to run after exctraction.

CheersNobby

Link to comment
Share on other sites

Don't use RunWait if you want to send keystrokes to the application.

Try this:

$Title = "Archivio auto-estraente WinRAR"
Run ("L:\saplogon.exe")
WinWait ($Title)
Sleep(500)
WinActivate ($Title)
sleep(250)
Send ("!i")
sleep(250)
Send ("!t")
Run ("msiexec SAPSSO.msi", "L:")
Send ("{ALT}e")
Send ("{ALT}f")
Edited by SlimShady
Link to comment
Share on other sites

Thanks SlimShady, I have done as you suggested, I now have this code in use:

Run ("L:\saplogon.exe")
WinWait("Archivio auto-estraente WinRAR")
Sleep(500)
WinActivate ("Archivio auto-estraente WinRAR")
sleep(250)
Send ("!i")
sleep(250)
WinWait("Conferma sosituzione file")
Sleep(500)
WinActivate ("Conferma sosituzione file")
sleep(250)
Send ("{ALT}t")
Run ("L:\msiexec SAPSSO.msi")
WinWait("SAP Kerberos SSO Support Setup")
Sleep(500)
WinActivate ("SAP Kerberos SSO Support Setup")
sleep(250)
Send ("{ALT}e")
sleep(250)
Send ("{ALT}f")

And it seems to work, except for an MSI error message that I will try to debug by myself.

Thanks again to all of you.

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