AutoHotkey Community

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: March 17th, 2010, 1:29 pm 
Offline

Joined: October 9th, 2009, 8:36 pm
Posts: 93
is there a way to execute a script when a certain window is opened or comes in focus
i've got the following working but i want it to be running in the background and just wait for the window to open to execute the script instead of hitting a hot key to activate.

Quote:
!t::
WinWaitActive, AutoHotkey Help
if ErrorLevel
{
return
}
else
msgbox Thanks for opening.
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2010, 3:22 pm 
--> SetTimer


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2010, 4:07 pm 
Offline

Joined: October 9th, 2009, 8:36 pm
Posts: 93
k i tried this and it's not working

Quote:
#Persistent
SetTimer, test, 250

return

test:
ifwinactive AutoHotkey Help
msgbox a
return


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

Joined: April 8th, 2009, 7:49 pm
Posts: 6071
Location: San Diego, California
It works! just as you wrote it.
What are the symptoms of it not working? If that makes any sense.

Code:
#Persistent
SetTimer, test, 250

return

test:
ifwinactive AutoHotkey Help
msgbox a
return



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

Joined: April 8th, 2009, 8:23 pm
Posts: 3036
Location: Rio de Janeiro - RJ - Brasil
Related: WinTrigger (template)

_________________
"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  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [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