AutoHotkey Community

It is currently May 27th, 2012, 2:57 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: March 18th, 2010, 6:25 pm 
I'm sure this has been done before but I couldn't find any good examples with search.

I have this new stupid software that wants to pop-up every time a client calls and hangs up. Window pictured below. The Title can change depending at the time.
Image


I've tried putting this together from examples and documentation at [url="http://www.autohotkey.com/docs/commands/WinClose.htm"]#WinClose[/url] and [url="http://www.autohotkey.com/docs/commands/_IfWinActive.htm"]#IfWinActive[/url] but I don't think I'm doing ii right at all. They don't work that is.

Code:
Loop
{
IfWinExist, WinText "Voice"
 WinClose
}


Code:
Loop
{
IfWinExist, WinText [Voice]
    WinClose ; use the window found above
}



I might also need some help making sure it doesn't close google voice if I open that tab :\


Thanks!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 6:28 pm 
Offline

Joined: April 8th, 2009, 8:23 pm
Posts: 3036
Location: Rio de Janeiro - RJ - Brasil
1) Wrong place. Should have posted it here.
2) Check WinTrigger.

You should use Voice, no [] or "" there.
Also, SetTitleMatchMode and WinTitle Alternatives.

_________________
"Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried.
"
Image
Antonio França
My stuff: Google Profile


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 6:47 pm 
Offline

Joined: November 28th, 2009, 4:45 am
Posts: 3089
Try this
Code:
Loop
{
WinWait Voice - ;Wait for a window whose title starts with Voice -
 WinClose ;Close It
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 8:12 pm 
None wrote:
Try this
Code:
Loop
{
WinWait Voice - ;Wait for a window whose title starts with Voice -
 WinClose ;Close It
}


This works perfectly, Thanks!

I added another to handle a different window with a slightly different name. Not sure if there is a way to combine them into the same script.

Code:
Loop
{
WinWait Active Voice -
 WinClose
}



After searching around I see a lot of other cool things to be done with AHK, I'll be playing with it some more and install it at home.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 8:18 pm 
u can use settimer, or just put 2 things in the same loop


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 8:28 pm 
Offline

Joined: November 28th, 2009, 4:45 am
Posts: 3089
If you set this SetTitleMatchMode in mode two at the top of your script it would get both windows.
See also GroupAdd
Code:
GroupAdd, KillIt , Voice -
GroupAdd, KillIt , Active Voice -

Loop
{
WinWait ahk_group KillIt ;Wait for a window whose title is in the group
 WinClose ;Close It
}


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], rbrtryn and 28 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