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.
Start Application - Ignore if already running option
Start Application - Ignore if already running option
I use the Start Application action to start an app. Sometimes I start the app when it is already running or would like to use the same button to start the app as well as get focus back to the app when it is already running. Depending on the application, if you run an app already running it might display an error or message ("instance already running", etc).
My feature suggestion is to provide a check box (just like the "wait till app is terminated before proceed") for the option to "ignore if application is already running".
I'm sure there is a simple way to do this using python script and conditional jumps with find window function (if possible can you provide an example?)
But I think the feature is also basic and standard enough to be in future releases.
Thanks.
katana80
My feature suggestion is to provide a check box (just like the "wait till app is terminated before proceed") for the option to "ignore if application is already running".
I'm sure there is a simple way to do this using python script and conditional jumps with find window function (if possible can you provide an example?)
But I think the feature is also basic and standard enough to be in future releases.
Thanks.
katana80
Re: Start Application - Ignore if already running option
Try playing with this... Action -> Window -> Find a window
Re: Start Application - Ignore if already running option
bskchaos:
Thx for the reply. Yeah I tried playing around with the already existing Find Window action.
That action works nice when you already expect the window (application) to be up and running.
And you can specify to 'ABORT if window is NOT FOUND'.
But it doesn't provide the inverse option of 'ABORT if the window IS FOUND' or 'CONTINUE if window is NOT FOUND' ... which is basically what I want.
Thx for the reply. Yeah I tried playing around with the already existing Find Window action.
That action works nice when you already expect the window (application) to be up and running.
And you can specify to 'ABORT if window is NOT FOUND'.
But it doesn't provide the inverse option of 'ABORT if the window IS FOUND' or 'CONTINUE if window is NOT FOUND' ... which is basically what I want.
Re: Start Application - Ignore if already running option
Or you could use Task.(created|activated|deactivated...) to enable/disable different macros for the same event.
Re: Start Application - Ignore if already running option
In my case, I just use this:
+Macro: Green - Start
Or, in xml style:
PS: I just love this software =D
+Macro: Green - Start
- Event: HID.Button.15
- Action: Find Window: MediaPortal.exe
- Action: Jump - if (above action) sucessful jump to "Green - MediaPortal Home"
- Action: Jump - if (above action) unsucessful jump to "Green - Run MediaPortal"
- Action: Find Window: MediPortal.exe
- Emulate Keystroke: h
- Start Program: MediaPortalLoader.bat
*Where this bat is where I configure to disable the monitor shutdown timeout, etc.
Or, in xml style:
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1399">
<Macro Name="Green - Start">
<Event Name="HID.Button.15" />
<Action>
Window.FindWindow(u'MediaPortal.exe', None, None, None, None, None, False, 0.0, 2)
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(74), 0, False)
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(77), 1, False)
</Action>
</Macro>
<Macro Name="Green - MediaPortal Home" id="74">
<Action>
Window.FindWindow(u'MediaPortal.exe', None, None, None, None, None, False, 0.0, 2)
</Action>
<Action>
Window.SendKeys(u'h', False)
</Action>
</Macro>
<Macro Name="Green - Run MediaPortal" id="77">
<Action>
System.Execute(u'C:\\Program Files\\Team MediaPortal\\MediaPortalLoader.bat', u'', 3, False, 2, u'')
</Action>
</Macro>
</EventGhost>PS: I just love this software =D
Re: Start Application - Ignore if already running option
User:
Thanks so much! Yes that is exactly what I wanted! I can't believe I overlooked such a useful feature. The more I familiarize myself with what's possible with EventGhost the more I love this software. Time to go reconfigure my macros again!
Thanks so much! Yes that is exactly what I wanted! I can't believe I overlooked such a useful feature. The more I familiarize myself with what's possible with EventGhost the more I love this software. Time to go reconfigure my macros again!
Re: Start Application - Ignore if already running option
I've done exactly the same but it hangs on the Find Window.User wrote:In my case, I just use this:
+Macro: Green - Start+Macro: Green - MediaPortal Home
- Event: HID.Button.15
- Action: Find Window: MediaPortal.exe
- Action: Jump - if (above action) sucessful jump to "Green - MediaPortal Home"
- Action: Jump - if (above action) unsucessful jump to "Green - Run MediaPortal"
+Macro: Green - Run MediaPortal
- Action: Find Window: MediPortal.exe
- Emulate Keystroke: h
- Start Program: MediaPortalLoader.bat
*Where this bat is where I configure to disable the monitor shutdown timeout, etc.
It does not go on.
can you help me ?
Re: Start Application - Ignore if already running option
You probably have the "stop macro if target is not found" checkbox turned on in the find window acition's config
Re: Start Application - Ignore if already running option
I have not seen that flag in the config... where is it ?jinxdone wrote:You probably have the "stop macro if target is not found" checkbox turned on in the find window acition's config
Re: Start Application - Ignore if already running option
Configure the "find window" action. The checkbox is in the top portion of the config window.+Macro: Green - Start
* Event: HID.Button.15
* Action: Find Window: MediaPortal.exe <---- here
* Action: Jump - if (above action) sucessful jump to "Green - MediaPortal Home"
* Action: Jump - if (above action) unsucessful jump to "Green - Run MediaPortal"
Re: Start Application - Ignore if already running option
Hi
here an example of what you need with tow different apps running based on autoremote and tasker app from android phone
here an example of what you need with tow different apps running based on autoremote and tasker app from android phone
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1669">
<Folder Name="web development">
<Macro Name="check if running" Expanded="True">
<Event Name="AutoRemote.Message.web" />
<Action>
Window.FindWindow(u'AptanaStudio3.exe', None, None, None, None, None, False, 0.0, 2)
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(34), 1, True)
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(26), 0, True)
</Action>
<Action>
Window.FindWindow(u'navicat.exe', None, None, None, None, None, False, 0.0, 2)
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(30), 1, False)
</Action>
</Macro>
<Macro Name="maximaiz aptana" id="26" Expanded="True">
<Action>
Window.FindWindow(u'AptanaStudio3.exe', None, None, None, None, None, False, 0.0, 0)
</Action>
<Action>
Window.Maximize()
</Action>
<Action>
Window.BringToFront()
</Action>
</Macro>
<Macro Name="start navicat" id="30" Expanded="True">
<Action>
System.Execute(u'C:\\Program Files (x86)\\Navicat Lite 8.2\\navicat.exe', u'', 0, False, 2, u'', False, False)
</Action>
<Action>
EventGhost.Wait(3.0)
</Action>
<Action>
Window.Minimize()
</Action>
</Macro>
<Macro Name="start aptana" id="34" Expanded="True">
<Action>
System.Execute(u'C:\\Users\\Eyal\\AppData\\Local\\Aptana Studio 3\\AptanaStudio3.exe', u'', 0, False, 2, u'', False, False)
</Action>
</Macro>
</Folder>
</EventGhost>