AutoHotkey Community

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: January 6th, 2010, 10:31 pm 
Offline

Joined: January 3rd, 2010, 6:33 am
Posts: 262
Trying to make a script that only works if a window exists. I'd like to have this auto run every 3-5 minutes. Not sure how to get it to auto run once and terminate the script if it isn't running:


Code:
greenlight=0
SetTitleMatchMode, 2
IfWinExist, "username that appears in Window title for each person"
greenlight=1
if greenlight=0
MsgBox, Program either not running or you are not authorized to use this script.  Please go to some URL for information.
[b]Auto exit<========Possible?[/b]


I guess I could set a master counter each time function and set them to check for the window every 100 functions or so, but I would eally like to have a single function that runs everyonce in a while.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 6th, 2010, 11:40 pm 
Offline

Joined: January 12th, 2007, 4:30 am
Posts: 531
Location: Norway
Quote:
Auto exit<========Possible?
ExitApp?

Quote:
I'd like to have this auto run every 3-5 minutes. Not sure how to get it to auto run once
Either by using the windows task scheduler, or using a timer, or loop+sleep.

Quote:
terminate the script if it isn't running
Isn't that something of a contradiction?

I don't understand what you're trying to accomplish or why, but I'll post this all the same as you may find something helpful.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2010, 12:22 am 
Offline

Joined: January 3rd, 2010, 6:33 am
Posts: 262
I meant if a particular program isn't running.

The program Window title has a user name in it, so I don't want the script to run if it isn't the proper user.

This helps a lot.

Thank you


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Leef_me, WillTroll and 26 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