Hi,
just trying to figure out how to do this (guess it's in and I just can't find it):
If test.exe is running it should be closed, if it isn't it should be started.
I can make the "if" check work, but can't figure out how to do the "else" part.
Thanks in advance,
Lars
EDIT: just figured it out: create 2 macros (1+2) with the same event, and one without (3) an event. set (1) to find window and make it jump to (3). if the window isn't found (2) is run. don't forget to enable (1) and (2) in (3).
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.
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.
[solved] if window exists do A else B
please post example
could someone please post a example of your usage of this.
Thanks
Scat
Thanks
Scat
-
XkFnHLgSVDl7
- Posts: 22
- Joined: Wed Mar 28, 2007 12:10 pm
Re: [solved] if window exists do A else B
this detects whether DScaler.exe is running, if yes it closes it, if not it starts D:\Media\DScaler\DScaler.bat
edit: oops, had a small bug in there, fixed now
Code: Select all
<Macro Name="Close DScaler" id="88">
<Action>Window.Close()</Action>
</Macro>
<Macro Name="DScaler running?" id="92">
<Event Name="Keyboard.LShift+LCtrl+LAlt+M"></Event>
<Action>Window.FindWindow(u'DScaler.exe', None, None, None, None, None, False, 0.0, 2)</Action>
<Action>EventGhost.NewJumpIf(XmlIdLink(88), 0, False)</Action>
<Action>System.Execute(u'D:\\\\Media\\DScaler\\DScaler.bat', u'', 3, False, 2, u'')</Action>
<Action>EventGhost.AutoRepeat(1.0, 1.0, 0.01, 3.0)</Action>
</Macro>- Bitmonster
- Site Admin
- Posts: 2239
- Joined: Mon Feb 06, 2006 10:28 pm
Re: [solved] if window exists do A else B
The code above is not suitable for pasting. You need to stuff the macros into a folder, then copy this folder and paste it here unmodified.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!