Hello, how can I do IF THEN ELSE with actions. I have a bunch of python script actions that I do this in and use "eg.plugins.*" command to execute actions but this makes the macros less visible and I was trying to avoids Jumps as this gets mess and makes it hard to copy and past other macros to reuse. Example.
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1640">
<Macro Name="IP2IR: Family Set to DVD (Computer)" id="485" Expanded="True">
<Action>
EventGhost.PythonCommand(u'eg.result = None')
</Action>
<Action>
EventGhost.PythonCommand(u'if eg.globals.bl1_status == False: eg.result = False')
</Action>
<Action>
EventGhost.PythonCommand(u'print eg.result')
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(536), 1, True)
</Action>
<Action>
EventGhost.PythonCommand(u'print eg.result')
</Action>
<Action>
EventGhost.PythonCommand(u'eg.result = None')
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(363), 2, True)
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(406), 0, True)
</Action>
<Action>
EventGhost.PythonCommand(u'print eg.result')
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(414), 0, True)
</Action>
<Action>
EventGhost.PythonCommand(u'print eg.result')
</Action>
</Macro>
</EventGhost>
Thanks in advance, B
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.
IF THEN ELSE with Actions
-
m19brandon
- Experienced User
- Posts: 177
- Joined: Mon Feb 03, 2014 10:36 pm
-
m19brandon
- Experienced User
- Posts: 177
- Joined: Mon Feb 03, 2014 10:36 pm
Re: IF THEN ELSE with Actions
That is want I'm doing now also but I want to stay in the same Marco.
Re: IF THEN ELSE with Actions
I don't think that's possible without using a Python script.m19brandon wrote:That is want I'm doing now also but I want to stay in the same Marco.
Why do you need to stay in the same macro? If you group macros in a folder it's almost like a single macro.
jonib
-
m19brandon
- Experienced User
- Posts: 177
- Joined: Mon Feb 03, 2014 10:36 pm
Re: IF THEN ELSE with Actions
Yes, I could do that
Thanks,

- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: IF THEN ELSE with Actions
I added a new action Jump with "Else" option to new EventGhost release.
This should facilitate the design that you need.
Pako
This should facilitate the design that you need.
Pako
-
m19brandon
- Experienced User
- Posts: 177
- Joined: Mon Feb 03, 2014 10:36 pm
Re: IF THEN ELSE with Actions
You are the man.
