Sign in to follow this  
Followers 0
Guest lsteinmetz

Problems to convert script

3 posts in this topic

Hello,

I have problems, to convert a V2 script into V3.

The script should fill out login fields automatically if they appear.

That means that the script must run in the backgroud.

Script (V2):

SetKeyDelay, 0

WinWaitClose, UPS32

[ADLIB]

Benutzer anmelden,, Send, JAK{TAB}1234{ENTER}

Fehler bei Objekt,, Send, !o

PROFIBOARD.DLL,, Send, {SPACE}

SQL Meldung,, Send, !o

User login,, Send, JAK{TAB}1234{ENTER}

Thanx

Share this post


Link to post
Share on other sites



I don't undertstand your V2 script as an ADLIB section is only one line

The [ADLIB]Section

The [ADLIB] section is optional, and if present should be placed at the end of the script file. The ADLIB section is designed to cope with unexpected conditions. The ADLIB section consists of single line commands that check if a window is active and if so, send keys to it.

The ADLIB section must start with the line "[ADLIB]".

Any Way with V3 you can put any thing in the function defined by AdLibEnable(...)

you just need to transform every line with if WinExist(...) then send(...) :ph34r:

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hello,

SetKeyDelay, 0
WinWaitClose, UPS32

[ADLIB]
Benutzer anmelden,, Send, JAK{TAB}1234{ENTER}
Fehler bei Objekt,, Send, !o
PROFIBOARD.DLL,, Send, {SPACE}
SQL Meldung,, Send, !o
User login,, Send, JAK{TAB}1234{ENTER}
To convert your ADLIB section, create an AdLib function, which you activate with AdLibEnable at the beginning of your script.

AdLibEnable("AdLibFunction")

Opt("SendKeyDelay", 1)
WinWaitClose("UPS32")

Func AdLibFunction()
    If WinExists("Benutzer anmelden") Then
        WinActivate("Benutzer anmelden")
        Send("JAK{TAB}1234{ENTER}")
    ElseIf WinExists("User login") Then
        WinActivate("User login")
        Send("JAK{TAB}1234{ENTER}")
    ElseIf WinExists("Fehler bei Objekt") Then
        WinActivate("Fehler bei Objekt")
        Send("!o")
    ElseIf WinExists("SQL Meldung") Then
        WinActivate("SQL Meldung")
        Send("!o")
    ElseIf WinExists("PROFIBOARD.DLL") Then
        WinActivate("PROFIBOARD.DLL")
        Send("{SPACE}")
    EndIf
EndFunc

Edit: Fix code.

Edited by Nutster

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Share this post


Link to post
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
Sign in to follow this  
Followers 0