AutoHotkey Community

It is currently May 27th, 2012, 1:53 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: January 25th, 2010, 1:30 am 
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]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2010, 1:36 am 
use RunWait


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2010, 1:37 am 
Offline

Joined: December 1st, 2006, 9:27 am
Posts: 460
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...

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2010, 3:47 am 
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.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, engunneer, JSLover, sjc1000 and 18 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group