Hi, I'm a newbie in EG. It's a fantastic automation software for me. I made a xml file with macros for all my HC elements (TVonoff, 1 channel, MuteVolume, AmpOnOff...) and X10 lights. It work perfectly. But I try now to make a software with a great graphic interface wich launch EG macros.
I made one but it's very long : my graphic soft launch an empty .exe applicaion, named "TVOnOFF.exe" wich open an empty window.
The macro have an event : "Task.Activated.TVOnOFF", a close instruction, and the IR action.
It's very long before the launch of the macro.
I tried to launch a .bat with "C:\Program Files\EventGhost\EventGhost.exe" -e TVOnOFF
exit
but it don't work.
I don't know the c++ and python languages but I tried to lern them.
Could you give me the entire code to launch my TVOnOFF macro with a .bat, a c++ or a python soft I could create with a graphic interface. Thanks a lot for all (and excuse my english, I'm french).
call a macro from an external soft
Re: call a macro from an external soft
The eventname for the macro has to be called
or just TVOnOFF.
You can also use the COM Interface of EventGhost
Code: Select all
Main.TVOnOFF
You can also use the COM Interface of EventGhost
Re: call a macro from an external soft
Hi. Thanks for your answer. I don't know what is the COM interface of EG ? But I think the code line you wrote is in EG. What I want is the code to call EG macros from an external application.
Re: call a macro from an external soft
You can create a COM Object in your application and call the function called TriggerEvent. Will be way faster than starting a whole process.
The code is just the name of the event. The events triggered from outside always have the prefix "Main" and therefore "Task.Activated.TVOnOFF" will not match. So nothing happens.
Make sure to uncheck the bottom left checkbox in EG and run your batch file again. You will see a "Main.TVOnOFF" entry in the log and can drag and drop that to you macro.
The code is just the name of the event. The events triggered from outside always have the prefix "Main" and therefore "Task.Activated.TVOnOFF" will not match. So nothing happens.
Make sure to uncheck the bottom left checkbox in EG and run your batch file again. You will see a "Main.TVOnOFF" entry in the log and can drag and drop that to you macro.
- jitterjames
- Experienced User
- Posts: 677
- Joined: Thu Aug 13, 2009 4:36 pm
- Location: Quebec, Canada
- Contact:
Re: call a macro from an external soft
if you use the com object does the TriggerEvent function just take 1 string as the parameter?
i.e.
eventGhostNameSpaceWhatEverItIs.TriggerEvent("myEventName 'payload goes here' ");
would work?
i.e.
eventGhostNameSpaceWhatEverItIs.TriggerEvent("myEventName 'payload goes here' ");
would work?
Re: call a macro from an external soft
OK thanks, I will see it if I can do it.
Thanks a lot. Bye.
Thanks a lot. Bye.