Jump to content

if window not active go next line


Recommended Posts

What's the difference with the other script you posted?

This one is simple and perhaps our other examples were confusing to the OP...  really I have no idea if this is what the OP wants as the lack of detail and language barrier is resulting in moving goalposts, so if this isn't what he wanted, I'm at a loss as to the question.

Link to comment
Share on other sites

Good night!

Also not quite figured out what you have claimed, but... 

1.

Correct me if I'm wrong: The function “_MyFunc1()” will only be called if the window “If WinExists("Installation de Adobe Shockwave Player", "Erreur lors de l'ouverture du fichier en écriture :") Then” does not exist, right? So, if “_MyFunc1()” ever it is called, how can this function to send commands to a window that does not exist, as this is a condition for it to be called.

2.

If your intention is to bypass the error message during installation, why you do not before kill the process "SWDNLD.EXE" (I think it is this that causes the error message)?

Ex:

If ProcessExists("SWDNLD.EXE") Then ProcessClose("SWDNLD.EXE")
ProcessWaitClose("SWDNLD.EXE", 1)
Run("Start your program here")
; Manipulate your windows here

 3.

Have you thought about using the functions WinSetOnTop() and / or SendKeepActive() when sending commands?

Hope this helps.

Link to comment
Share on other sites

This is the best I could do...

Example()

Func Example()

    Do
        ; Let's wait on Windows#1...If it ever comes............If not, maybe Window#2....
    Until WinWaitActive("test.txt - Notepad", "", 1) Or WinWaitActive("Untitled - Notepad", "", 1)
    ; Total wait time here could be as high as 2 seconds.
    
    If WinActive("Untitled - Notepad") Then
        MsgBox(262144, "", "Untitled - Notepad window was active")
        ; Go somewhere over the rainbow
    EndIf
    If WinActive("test.txt - Notepad") Then
        MsgBox(262144, "", "First window 'test.txt' was active")
        ; Go somewhere else over the rainbow
    EndIf
    MsgBox(262144, "", "Example finished.  Script will now end.", 2)

EndFunc   ;==>Example
Edited by NewPlaza
Link to comment
Share on other sites

"script must wait window1 but while waiting window1 if come window 2 go to window2 and next line"

"script must wait for window1, but while waiting for window1, if window 2 appears, act on that one."

This is my understanding of it, meaning that he may need that while window 1 is active, the second one might appear, like a popup,

so then he'll need the script to react to the second one, and "leave the first alone!?".

Dunno, just thought to analyse the phrase more closely.

Edited by careca
Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Boa noite!
Não sei se o que tu queres é algo parecido com este exemplo.
Comigo funcionou.

Opt('WinDetectHiddenText', 1)
;Opt('WinWaitDelay',100)

_InstallShockwave()

Func _InstallShockwave()

    Local $InstallFile = @ScriptDir & "\Shockwave_Installer.exe"
    Run($InstallFile)

    While ProcessExists("Shockwave_Installer.exe")
        If WinExists("Instalação do Adobe Shockwave Player", "Erro ao abrir o arqu") Then
            WinActivate("Instalação do Adobe Shockwave Player", "Erro ao abrir o arqu")
            SendKeepActive("Instalação do Adobe Shockwave Player", "Erro ao abrir o arqu")
            ;Send("!a") ; Abortar
            ;Send("!r") ; Repetir - Se o erro continuar entras em loop infinito
            ;Send("!i") ; Ignorar e continuar
            ;ControlCommand("Instalação do Adobe Shockwave Player", "Erro ao abrir o arqu", "Button1", "Check") ; Abortar
            ;ControlCommand("Instalação do Adobe Shockwave Player", "Erro ao abrir o arqu", "Button2", "Check") ; Repetir - Se o erro continuar entras em loop infinito
            ControlCommand("Instalação do Adobe Shockwave Player", "Erro ao abrir o arqu", "Button3", "Check") ; Ignorar e continuar
            ;ControlCommand("Instalação do Adobe Shockwave Player", "Cancelar", "Button3", "Check") ; - Esta linha de código só deve ser usada se a instalação for abortada
        EndIf
        ;Sleep(10)
        If WinExists("Installing Adobe Shockwave Player", "Google Toolbar") Then
            WinActivate("Installing Adobe Shockwave Player", "Google Toolbar")
            SendKeepActive("Installing Adobe Shockwave Player", "Google Toolbar")
            ControlCommand("Installing Adobe Shockwave Player", "Google Toolbar", "Button1", "UnCheck")
            Sleep(10)
            ControlCommand("Installing Adobe Shockwave Player", "Google Toolbar", "Button2", "Check")
        EndIf
        ;Sleep(10)
        If WinExists("Instalação do Adobe Shockwave Player", "Successfully Completed") Then
            WinActivate("Instalação do Adobe Shockwave Player", "Successfully Completed")
            SendKeepActive("Instalação do Adobe Shockwave Player", "Successfully Completed")
            ControlCommand("Instalação do Adobe Shockwave Player", "Successfully Completed", "Button2", "Check")
        EndIf
        ;Sleep(10)
    WEnd
EndFunc   ;==>_InstallShockwave
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...