Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Opposite reaction to "Find Window"?

If you have a question or need help, this is the place to be.
tstack77
Posts: 6
Joined: Sat Feb 13, 2010 8:24 pm

Opposite reaction to "Find Window"?

Post by tstack77 »

I would like to add an event to my macro chain that would stop the macro if a certain window is open. Currently I can only see "Find Window" that allows the macro to execute if that window is open.

Is there an opposite reaction to "Find Window"?
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Opposite reaction to "Find Window"?

Post by Pako »

tstack77 wrote:I would like to add an event to my macro chain that would stop the macro if a certain window is open. Currently I can only see "Find Window" that allows the macro to execute if that window is open.

Is there an opposite reaction to "Find Window"?
Of course there is. Use action "Python Command":
StopIfOpen.jpg
StopIfOpen.jpg (15.58 KiB) Viewed 4392 times
Pako
tstack77
Posts: 6
Joined: Sat Feb 13, 2010 8:24 pm

Re: Opposite reaction to "Find Window"?

Post by tstack77 »

sweet, still learning here :D
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Opposite reaction to "Find Window"?

Post by Bartman »

You also could have done a conditional jump if you won't to avoid scripting
BigBlack
Posts: 45
Joined: Wed Jan 13, 2010 3:19 am

Re: Opposite reaction to "Find Window"?

Post by BigBlack »

Hi guys, i've a long process that it's long about 1 hour or more.... It's a wake up alarm that turn on my mediamonkeyplayer and my stereo... And then bring up the volume every 15 min :P I know... :P But it's not simple to wake up me :P However I'd like to stop the script, even if in execution, closing mediamonkey windows.... Or better, I think i can make a pop up windows that ask me to click ok when i want to stop the script and turn off mediamonkey and the stereo... How can i do this? I don't know python language... Thank you! Bye bye
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Opposite reaction to "Find Window"?

Post by Pako »

You can try this Python script:

Code: Select all

mBox = wx.MessageDialog(parent = None,message="My Message", caption='My Caption', style=wx.YES_NO)
if mBox.ShowModal() == wx.ID_YES:
    eg.TriggerEvent("YesPressed", prefix="MyEvent")
Pako
BigBlack
Posts: 45
Joined: Wed Jan 13, 2010 3:19 am

Re: Opposite reaction to "Find Window"?

Post by BigBlack »

Ok but how i can make it stop the process still running? Or the script sto also the process?
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Opposite reaction to "Find Window"?

Post by Pako »

How do I know how to stop the process if I do not know anything about the process?
Pako
BigBlack
Posts: 45
Joined: Wed Jan 13, 2010 3:19 am

Re: Opposite reaction to "Find Window"?

Post by BigBlack »

So in your code i need to insert the message... then what's my caption? Then in "my event" what i need to insert? What do you need to know of my process to tell me how to stop it? Sorry but as I tell you, i don't know python... :(
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Opposite reaction to "Find Window"?

Post by Pako »

Why do not you try it, if you do not know?
Testing is just so simple:
1) The code is copied to the window "Python Script"
2) Press the Test button (you know, why is it so called?)
3) You see a dialogue !
4) When you press Yes, in the logger will appear a new event
5) When you press the No, nothing will happen, just close the dialog
MessageBox.jpg
When you want to use in your configuration, do this:
1) Create a new macro and your new script just put into this macro
2) If you want this macro to run (for example) every 15 minutes, you use plugin "Timer" and macro run from events, that triggered plugin "Timer".
3) The event, which is triggered from your script (for example "MyEvent.YesPressed") assign to a macro, which make stop your process (for example closing window).
Pako
BigBlack
Posts: 45
Joined: Wed Jan 13, 2010 3:19 am

Re: Opposite reaction to "Find Window"?

Post by BigBlack »

Ok, I've created the windows and set the event in the macro that close mediamonkey and turn off the stereo... But if the first macro... the turn on one... it's still in execution with yellow EG icon... I can't stop manually, and neither with the new macro starting with the yes event... So how can I do?
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Opposite reaction to "Find Window"?

Post by Pako »

I'm sorry, but with my lousy English skills I do not understand, what is your problem.
If you want to help you must write your posts more comprehensible.
It is good to use the shortest and simplest sentences.
I welcome, when the search for a solution to your problem, someone else joins.
He would need to understand your posts better than me.

Pako
BigBlack
Posts: 45
Joined: Wed Jan 13, 2010 3:19 am

Re: Opposite reaction to "Find Window"?

Post by BigBlack »

Ok I retry... :) I've the macro that turn on mediamonkey and my stereo, and another that turn off them... The macro "turn on" start every morning... I put the python script that you gave me in the "turn on" macro... And set the "yes event" to start the "turn off" macro. "Turn on" macro works for about 1 hour and the icon of EventGhost it's yellow... So if the macro still working I can't start the "turn off" one... And I can't stop even manually... So how can i do?

However putting pythons script in the "turn on" macro, the macro stop the step later and don't go on, and the EventGhost icon became red and i have to close it and reopen to interact again..

I hope that you understand me now Thank you bye bye
User avatar
jitterjames
Experienced User
Posts: 677
Joined: Thu Aug 13, 2009 4:36 pm
Location: Quebec, Canada
Contact:

Re: Opposite reaction to "Find Window"?

Post by jitterjames »

maybe you should post your 1 hour macro. I don't think you want a macro that runs for an hour keeping the icon yellow. probably you want to use a 1 hour timer that does not block eventGhost from executing (yellow icon).

you are probably using the action "wait some time" which is only good for short periods.
I think you want to add the "timer" plugin and play around with that.
BigBlack
Posts: 45
Joined: Wed Jan 13, 2010 3:19 am

Re: Opposite reaction to "Find Window"?

Post by BigBlack »

These are my 2 macro... With timer, i must to put timer after python window... and make it start for 900 sec, generating event "Bring Up Volume"; than I must create a macro with this event inside and inside it i must put IR to bring up the volume? But then, to make it repeat every 15 min or 900 sec what i need to do? There's a loop to make it repeat about 4 time? But in this case isn't the same? The EventGhost icon isn't yellow the same? I don't know if I've explained well...
Attachments
Turn off Macro
Turn off Macro
TurnOffSveglia.png (9.84 KiB) Viewed 4252 times
Turn On Macro
Turn On Macro
Last edited by BigBlack on Sun Apr 11, 2010 3:19 pm, edited 1 time in total.
Post Reply