tpiper
-
Posts
12 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by tpiper
-
-
Cory, I appreciate quick reply. The second option sounds good because I'm not real familiar with VBscript. Also could you expand a little more on changing controls?
Thanks,
Tom
-
I'm looking for a way to detect if a program is in use, and if it hasn't been used for say, 15 minutes, then it would shut down. I'm able to time the program but can't seem to get my mind around how to detect user activity within the program (keystrokes, mouse movement, etc.), not just that it's focused are is running in the background.
Any thoughts would be greatly appreciated!
Thanks
-
Kevin, yes except I also need the window to close if there is no user response at all.
Tom
If I understand correctly then you want something like this:Activate or Launch: "notepad" OR "notepad.exe" Wait For Window Title: "notepad" If Message: "Do you want to leave Notepad open?" Else Window Close: "notepad" End If
Copy this code and paste it into a new macro:
<LAUNCHYES3:0:0112notepad<LAUNCH:notepad.exe><WAITWIN2:000010:000000:notepad><REM2:><IFMESS3:00005:1:1:Do you want to leave Notepad open?Do you want to leave Notepad open?Center:Center><ELSE><WCLS:notepad><ENDIF>
-
I have a situation that requires that a window remains open if the user hits “yes” and closes either if they hit “no”, or if nothing is typed into the If Message dialog box within a certain length of time. I can make this work if the default button is “no”, but the user wants the default to be yes so that they don’t inadvertently close the program by hitting enter.
I’ve also tried inserting an If Window on Top command to look for the IF Message dialog box still being open after "X" seconds but that didn't work either.
I know there’s probably a simple solution but I’m fairly new at this and can’t seem to get my head around the logic. Also, is there possibly another way to go beside using the If Message dialog box?
Thanks for any help!
Tom
-
Nevermind, I found out what was happening. I overlooked the fact that it was set up as a scheduled macro...duh!
Works great now.
Thanks again,
Tom
Hey Tom,It does not require them both to run at the same time. The primary macro only runs every 5 minutes. The secondary macro only runs when "This App"
comes to the top.
If you're using a repeat loop within the primary macro in order to establish the every-5-minutes prompt, then the secondary macro won't be able to run
(ever); however with the primary macro set on a schedule to run every 5 minutes, then you won't need a repeat loop inside it at all to perform this
function. Thus you should only ever see one of 2 situations with this set-up:
- Situation 1: No macro is running for 5 minutes, then the primary macro runs, does it's thing, then stops running and the 5 minute timer starts over.
- Situation 2: No macro is running for 3 minutes, then the User brings This App to the top in order to use it. At this point the secondary macro runs very
quickly disabling, then re-enabling the primary macro - effectively resetting the 5 minute timer.
- Situation 1: No macro is running for 5 minutes, then the primary macro runs, does it's thing, then stops running and the 5 minute timer starts over.
-
Steve, after looking at the code and trying to follow the logic of what you're doing I didn't see where the 5 minute timer was set up. What did I miss?
Thanks,
Tom
Hey Tom,It does not require them both to run at the same time. The primary macro only runs every 5 minutes. The secondary macro only runs when "This App"
comes to the top.
If you're using a repeat loop within the primary macro in order to establish the every-5-minutes prompt, then the secondary macro won't be able to run
(ever); however with the primary macro set on a schedule to run every 5 minutes, then you won't need a repeat loop inside it at all to perform this
function. Thus you should only ever see one of 2 situations with this set-up:
- Situation 1: No macro is running for 5 minutes, then the primary macro runs, does it's thing, then stops running and the 5 minute timer starts over.
- Situation 2: No macro is running for 3 minutes, then the User brings This App to the top in order to use it. At this point the secondary macro runs very
quickly disabling, then re-enabling the primary macro - effectively resetting the 5 minute timer.
- Situation 1: No macro is running for 5 minutes, then the primary macro runs, does it's thing, then stops running and the 5 minute timer starts over.
-
Okay, thanks for the explanation.
Tom
Hey Tom,It does not require them both to run at the same time. The primary macro only runs every 5 minutes. The secondary macro only runs when "This App"
comes to the top.
If you're using a repeat loop within the primary macro in order to establish the every-5-minutes prompt, then the secondary macro won't be able to run
(ever); however with the primary macro set on a schedule to run every 5 minutes, then you won't need a repeat loop inside it at all to perform this
function. Thus you should only ever see one of 2 situations with this set-up:
- Situation 1: No macro is running for 5 minutes, then the primary macro runs, does it's thing, then stops running and the 5 minute timer starts over.
- Situation 2: No macro is running for 3 minutes, then the User brings This App to the top in order to use it. At this point the secondary macro runs very
quickly disabling, then re-enabling the primary macro - effectively resetting the 5 minute timer.
- Situation 1: No macro is running for 5 minutes, then the primary macro runs, does it's thing, then stops running and the 5 minute timer starts over.
-
Steve, that's pretty slick! I'll give it try.
But does this require two macro's to be running at the same time? I thought this wasn't possible in the non-pro version.
Thanks,
Tom
I had never noticed the built-in time-out on this command. Awesome!Personally, what I would do in this case (admittedly I don't know the full spectrum of what it is you do, so feel free to completely ignore me) would be to
make the macro as unobtrusive as possible.
<Begin Boring Personal Example>:
I work with a Citrix application that times itself out ever 4-8 minutes (it is completely inconsistent). This was a problem when it would time out and then
I'd run a macro that needed to call the app, which had timed out in the mean-time, requiring a sign in. Rather than building a series of commands to
determine if the app had gone to a log-in page or to the page I actually wanted, I built a simple macro that would refresh the application automatically
every 4 minutes. Unfortunately, that got to be a headache when I was using the app regularly or when it would refresh immediately after I reached the
information I was looking for (the refresh takes the app back to the first page of a hundreds-of-pages-long document).
I made some modifications so now any time the application is refreshed manually or via another macro accessing the application, the timer starts over.
This way, if I don't use the app for 4 minutes, and neither do any of my other macros, I get a text box that pops up alerting the user that the app is
refreshing and to be patient for a few seconds. Once the refresh is completed, the app is minimized, the text box goes away, and the user can get back to
work.
I can go hours without seeing the text box, or I can go an hour and see it 15 times, depending on whether or not and how often I'm using the app.
<End Boring Personal Example>
I guess my point is that you could probably build something around your macro, so that when the application in question does get used, the timer on the
macro starts over, and only prompts the user if the application has definitely not been looked at.
The code is pretty basic (and relies on a second, separate macro):
The primary macro would look like this (I named the application "This App"):
Launches on a schedule: Every 5 minutes
If Window Title "This App" is running If Message: "Don't Forget to Close This App" Else Text Box Display: Closing Window Close: "This App" Text Box Close: No Response End If End If
If This App is not running, nothing happens. If it is running, the If Message appears every 5 minutes as long as This App is running.
---------------------------------------------------------
The secondary code, which blocks the If Message when it's clear that the User is actually using the application, looks like this:
Launches whenever window title "This App" comes on top.
Macro Disable: test 1 for tpiper Macro Enable: test 1 for tpiper
This way, if This App comes to the top, the 5 minute timer for the primary macro gets reset to zero. If the User is clearly using the app, then they won't be
bugged by a constant barrage of "Are you using this?" requests.
Anyway, I hope this helps!
-
Thanks much...that did the trick. Your help is much appreciated!
Tom
-
Use the If Message command. It allows you to choose the types of buttons to display, which one is the default and a Default Time Out value.
Kevin, I tried it and I can time out the the message box, but I don't see how this will terminate the program that I'm trying to close without clicking on a button. I need the macro to run such that if no button at all is clicked then the program will terminate after a certain period of time. What am I missing?
Thanks,
Tom
-
I have a timer set up that displays a reminder message for a user to close a program if they aren't using it. I have a repeat loop that contantly displays the reminder and a dialog box every few minutes. If they type yes in the dialog box then they are given more time. If they type no or hit cancel then the program closes, which is what I want.
My problem is that I also want the program to automatically close if there is no response at all, such as if they are away from their computer for long periods of time and don't respond to the dialog box.
I'm new to using Macro Express. I've tried using OR logic to terminate the program after a period of time but can't seem to get that to work. Also tried to control the cancel button in the dialog box with an automated click on the cancel button, but again didn't work. I'm sure there is a simple way to do this but can't seem to find the right way.
Any help is appreciated!
Tom
Program Activity
in Macro Express and Macro Express Pro
Posted
Cory, thanks for the explanation. That helps.
Tom