Sign in to follow this  
Followers 0
langthang084

Problem with winactivate?

8 posts in this topic

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



#2 ·  Posted (edited)

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.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

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

BeatsPlayer - Music player.

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

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.

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

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

BeatsPlayer - Music player.

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

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.

 

Share this post


Link to post
Share on other sites

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

#6 ·  Posted (edited)

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.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

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

BeatsPlayer - Music player.

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

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.

 

Share this post


Link to post
Share on other sites

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

Glad it's sorted out. :)


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

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

BeatsPlayer - Music player.

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

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.

 

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