Hints, tips and tricks for newbies
Moderators: Dorian (MJT support), JRL
-
Alpha_AI
- Pro Scripter
- Posts: 61
- Joined: Wed Sep 19, 2007 9:30 am
Post
by Alpha_AI » Sun Aug 10, 2008 2:09 pm
Hello
I would like to check if an application has closed.
I mean like closed (terminated), not hidden or minimized.
Kind regards,
Ben
-
GarryP
- Junior Coder
- Posts: 27
- Joined: Sat Feb 04, 2006 12:01 pm
Post
by GarryP » Sun Aug 10, 2008 6:36 pm
-
Alpha_AI
- Pro Scripter
- Posts: 61
- Joined: Wed Sep 19, 2007 9:30 am
Post
by Alpha_AI » Mon Aug 11, 2008 12:17 am
So how would I periodically check to see if it has closed without consuming too much memory.
Maybe a timer or a foor loop?
You see my macro will have to continuously monitor when an app has closed.
Ben
-
Alpha_AI
- Pro Scripter
- Posts: 61
- Joined: Wed Sep 19, 2007 9:30 am
Post
by Alpha_AI » Mon Aug 11, 2008 6:18 am
i'll tell u exactly what IM after
Lets say my compiled macro is called 'mymacro.exe'
and I have an app running named 'myapp.exe'
mymacro.exe continuously checks to see if myapp.exe is still running
if it is not running no more, then terminate mymacro.exe
Ben
-
Me_again
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
Post
by Me_again » Mon Aug 11, 2008 1:51 pm
It's very hard to answer your question without knowing what mymacro does. If mymacro interacts with myapp then it would be logical to add the check for a running myapp into the code just before the interaction. If mymacro's only purpose is to monitor that myapp is running then a simple loop with a wait> is all you need.