AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WinWait and WinWaitClose Problem

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
mmmg
Guest





PostPosted: Mon Jan 25, 2010 12:30 am    Post subject: WinWait and WinWaitClose Problem Reply with quote

I'm very new at this. As in last night was my first time making a script. I'm just trying to make a really simple script that will launch google chrome than wait for google chrome to close and then run Ccleaner and flush the dns entries. Everything works except that after I exit google chrome, nothing happens. Autohotkey says that the last script line that was executed is WinWait, - Google Chrome. And it stays there for ever. It's probably a very simple solution, I just don't know what it is. Thanks in advanced.

Code:
Run, C:\Users\Michael\AppData\Local\Google\Chrome\Application\chrome.exe
WinWait, - Google Chrome
WinWaitClose

MsgBox, 4, Clean Session, Would you like to clear browsing session?, 60
IfMsgBox, No
    return
Run, C:\Program Files (x86)\CCleaner\ccleaner.exe /AUTO
Run, cmd /c "ipconfig /flushdns",, Hide
MsgBox, 0,  Clean Session, Browsing session is cleared., 30
[/quote]
Back to top
Z_Gecko
Guest





PostPosted: Mon Jan 25, 2010 12:36 am    Post subject: Reply with quote

use RunWait
Back to top
Micahs



Joined: 01 Dec 2006
Posts: 460

PostPosted: Mon Jan 25, 2010 12:37 am    Post subject: Reply with quote

You're going to want to look at SetTitleMatchMode. Add
Code:
SetTitleMatchMode, 2
AHK Documentation wrote:
2: A window's title can contain WinTitle anywhere inside it to be a match.
The default (1) is that it must start with the given text to match. HTH

EDIT: Or just use RunWait...
_________________
Back to top
View user's profile Send private message
mmmg
Guest





PostPosted: Mon Jan 25, 2010 2:47 am    Post subject: Reply with quote

Thanks. I had tried SetTitleMatchCode before and it didn't work so I tried RunWait, and it didn't work but then I tried SetTitlematchCode Again and it worked fine. So I don't know what the problem was, but it is fixed so thank you.
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group