Jump to content
Sign in to follow this  
langthang084

Problem with winactivate?

Recommended Posts

langthang084

here is my code 

Do
    send("!a")
        sleep(300)
        send("{space}")
Until WinActive("Microsoft Office Word", "made 1 replacements.")

I want to send ALT + A and SPACE until the window "Word has completed its search of the document and has made 1 replacements." appear. But if i run this scripts above, it will run forever. And When I change to "WinActive("Microsoft Office Word", "1"), it stop when "made 10 replacements" appear. 

 

 

Share this post


Link to post
Share on other sites
careca

When you use "WinActive("Microsoft Office Word", "2")" Does it stop at "made 2 replacements"?

If it does, im inclined to think it may have something to do with timing..

How can i reproduce it?

EDIT: BTW check the title of the topic.

Edited by careca

Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

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

GPO Tool - Export/Import Group policy settings.

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.

Firefox Profile Backup - Backup/restore previously saved profile.

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

Share this post


Link to post
Share on other sites
langthang084

No. It stop at "made 29 replacements" :|

Share this post


Link to post
Share on other sites
careca

Try:

While WinActive("Microsoft Office Word", "made 1 replacements.") = 0
    send("!a")
    sleep(300)
    send("{space}")
WEnd

Check if the word you are looking for is realy "replacements." and not "replacement." since it's 1 replacement.


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

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

GPO Tool - Export/Import Group policy settings.

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.

Firefox Profile Backup - Backup/restore previously saved profile.

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

Share this post


Link to post
Share on other sites
langthang084

It still run again and again :|.  I also change to "made 1 replacement" but not successful

Share this post


Link to post
Share on other sites
careca

Try adding the opt WinTitleMatch 2 option to the top, and change the title to just "made 1" or "1 replacement".

Im not at my desktop, so i may be wrong, but i think it's that or very similar, search for title match in help file and you'll see it.

EDIT: its WinTitleMatchMode 2

Edited by careca

Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

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

GPO Tool - Export/Import Group policy settings.

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.

Firefox Profile Backup - Backup/restore previously saved profile.

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

Share this post


Link to post
Share on other sites
langthang084

Thanks you! I have solved it. When i put sleep(300) below "send("{space}") and use "replacement", not "replacements", now it run correctly.  

Here's my code:

Do
    send("!a")
    sleep(300)
    send("{space}")
    sleep(300)
Until WinActive("Microsoft Office Word", "made 1 replacement.")

Share this post


Link to post
Share on other sites
careca

Glad it's sorted out. :)


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

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

GPO Tool - Export/Import Group policy settings.

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.

Firefox Profile Backup - Backup/restore previously saved profile.

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

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  

×