shck Posted June 20, 2012 Report Share Posted June 20, 2012 Hi, I launch a program with MEP, after 3-10 Minutes the program closed automaticly (not a MEP action). How can I handle the closed window? I think a delay of 600 seconds it's not the most time-efficient variant. Warm regards Christian Quote Link to comment Share on other sites More sharing options...
acantor Posted June 20, 2012 Report Share Posted June 20, 2012 What do you want to happen when the program closes? Quote Link to comment Share on other sites More sharing options...
Cory Posted June 20, 2012 Report Share Posted June 20, 2012 I don't understand what you mean by "handle the closed window". Is your macro doing something the entire time the program is running? I seem to remember something like this in your previous posts. Let's assume this is the case for now. First off I am not a fan of macros that run long periods of time with delays nested in repeats. I think it's better to have a macro that runs at the periodic interval from the scheduler instead. When the program's window title no longer exists it disables itself and terminates. But if you must do it in one big loop you can do the same ting. Evaluate if the window title or a control in the program still exists and if it does self terminate. Quote Link to comment Share on other sites More sharing options...
paul Posted June 20, 2012 Report Share Posted June 20, 2012 You can also have a macro start automatically when a specified window closes, or when a process stops running. Quote Link to comment Share on other sites More sharing options...
shck Posted June 20, 2012 Author Report Share Posted June 20, 2012 Where can I find the command? Under Windows/Prorams? Quote Link to comment Share on other sites More sharing options...
acantor Posted June 21, 2012 Report Share Posted June 21, 2012 Where can I find the command? Under Windows/Prorams? If you are looking for a way to activate a macro when a window closes or a process ends, you will find these options in the Script Editor under the "Activations" tab rather than under the "Script" tab. You can cause a macro to run when a window opens, closes, gains focus, etc. Caveat: Some people have reported reliabilty or latency problems with macros triggered by window events. Activation when a window gains focus does seem to work well. Quote Link to comment Share on other sites More sharing options...
shck Posted June 21, 2012 Author Report Share Posted June 21, 2012 I cant find under Windows/Programs the code for a action, when a window is closing. For i.e. I want to open Google Chrome, after I closed (exit) the Firefox-Window. Quote Link to comment Share on other sites More sharing options...
terrypin Posted June 21, 2012 Report Share Posted June 21, 2012 As Alan said, these are ACTIVATION options, not macro commands. Terry, UK Quote Link to comment Share on other sites More sharing options...
Cory Posted June 21, 2012 Report Share Posted June 21, 2012 shck you really need to explain better what it is you are doing. Is a macro running already? Are you operating in a loop? We don't know. What you're saying doesn't make sense. It sounds like you want a macro command to execute when you close Chrome. But if no macro is running no command can be executed. Remember this is not an event driven language. Only the activations are event driven. And if you do have a macro running the best you can do is use a "Wait For" command or use a loop with a delay and evaluation built in. BTW There is a Wait for Program to Terminate command. Quote Link to comment Share on other sites More sharing options...
shck Posted June 21, 2012 Author Report Share Posted June 21, 2012 Perhaps it is easier to understand with a picture: Instead of waiting for Closed Program (I dont know the command in MEP) I use "Waiting 600 Seconds". Quote Link to comment Share on other sites More sharing options...
terrypin Posted June 21, 2012 Report Share Posted June 21, 2012 Did you try Paul's suggestion? BTW, why upload a graphic to show a few lines of text? -- Terry, UK Quote Link to comment Share on other sites More sharing options...
acantor Posted June 21, 2012 Report Share Posted June 21, 2012 Maybe this script will give you an idea of how to do it. This script is activated when Firefox closes. It displays a message, and after you click OK, the macro causes Word to open. Make sure to examine the "Activations" tab! That's where you will find what is causing the macro to fire when Firefox closes. Test macro.mex Quote Link to comment Share on other sites More sharing options...
shck Posted June 21, 2012 Author Report Share Posted June 21, 2012 Ok, sorry - the "Process Stops Running" is probably a new feature for versions higher than 3.7, so I could not find the point. Thx for your help. Quote Link to comment Share on other sites More sharing options...
acantor Posted June 22, 2012 Report Share Posted June 22, 2012 It sounds like you are using Macro Express, not Macro Express Pro! There is no Macro Express Pro 3.7... Quote Link to comment Share on other sites More sharing options...
Cory Posted June 22, 2012 Report Share Posted June 22, 2012 Good catch Alan. Shck I would use the Wait for Program to Terminate command. Quote Link to comment Share on other sites More sharing options...
shck Posted June 24, 2012 Author Report Share Posted June 24, 2012 Alan, thats it, I used only ME - with MEP everything works fine. Sorry for the confusion with ME & MEP. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.