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.
Can i specify a specific event to activate my macro?
-
Boomslangnz
- Posts: 2
- Joined: Sat Jun 23, 2012 7:34 am
Can i specify a specific event to activate my macro?
Hi
is it possible to have IR codes blasted if i opened 123.bat but not for 122.bat
so only for that specific file etc? and not every bat file
thanks
is it possible to have IR codes blasted if i opened 123.bat but not for 122.bat
so only for that specific file etc? and not every bat file
thanks
-
Flyingsubs
- Experienced User
- Posts: 127
- Joined: Sat Dec 29, 2012 11:26 pm
Re: Can i specify a specific event to activate my macro?
I don't think so. you have to do everything in eventghost. You can have it work by when you launch a .bat file it sends an IR signal.
-Flyingsubs
-Flyingsubs
Re: Can i specify a specific event to activate my macro?
What does the .bat file look like?
You could add a similar line in the .bat file to trigger an event in EventGhost and use it in a macro to blast the IR code:
kalia
You could add a similar line in the .bat file to trigger an event in EventGhost and use it in a macro to blast the IR code:
Code: Select all
"C:\Program Files (x86)\EventGhost\EventGhost.exe" -event BlastCodeRe: Can i specify a specific event to activate my macro?
kalia wrote:What does the .bat file look like?
You could add a similar line in the .bat file to trigger an event in EventGhost and use it in a macro to blast the IR code:
kaliaCode: Select all
"C:\Program Files (x86)\EventGhost\EventGhost.exe" -event BlastCode
Code: Select all
13:57:16: 1 MainThread: Named Pipe: Command: eg.TriggerEvent, Parameters: (u'BlastCode',)
13:57:16: 0 EventGhost.Pipe.Thread: Named Pipe: return data: <eg.Classes.EventGhostEvent.EventGhostEvent object at 0x0AEEE3B0>
13:57:16: 0 EventGhost.Pipe.Thread: Named Pipe: Creating pipe
Traceback (most recent call last):
File "EventGhost.pyw", line 53, in <module>
File "C:\Program Files (x86)\EventGhost\eg\__init__.py", line 31, in <module>
import Cli
File "C:\Program Files (x86)\EventGhost\eg\Cli.py", line 172, in <module>
'eg.TriggerEvent, %s' % str(args.startupEvent)
File "C:\Program Files (x86)\EventGhost\eg\NamedPipe.py", line 253, in send_message
return eval(data)
File "<string>", line 1
<eg.Classes.EventGhostEvent.EventGhostEvent object at 0x0AEEE3B0>
^
SyntaxError: invalid syntax
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Can i specify a specific event to activate my macro?
you found a bug my friend. the syntax is the same. i didn't even think about how it works if there already isn't an EG instance running.
going to have to fix that
going to have to fix that
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Can i specify a specific event to activate my macro?
that bug has been fixed if you see here.
viewtopic.php?f=12&t=9730
but there was also another issue as well which the file below fixes.
you will need to replace the eg\Classes\EventThread.py file with the attached one.
the syntax for using it is as follows
-event suffix "payload" prefix
i surround the payload with quotes because if you have any spaces in the payload it will have to be surrounded by quotes for it to work properly.
viewtopic.php?f=12&t=9730
but there was also another issue as well which the file below fixes.
you will need to replace the eg\Classes\EventThread.py file with the attached one.
the syntax for using it is as follows
-event suffix "payload" prefix
i surround the payload with quotes because if you have any spaces in the payload it will have to be surrounded by quotes for it to work properly.
- Attachments
-
- EventThread.py
- (4.67 KiB) Downloaded 68 times
Re: Can i specify a specific event to activate my macro?
It gives this error with the new file you attached:
Code: Select all
13:40:24: 0 EventGhost.Pipe.Thread: Named Pipe: Data received
13:40:24: 1 MainThread: Named Pipe: Command: eg.TriggerEvent, Parameters: (u'yy',)
13:40:24: 0 EventGhost.Pipe.Thread: Named Pipe: return data: <eg.Classes.EventGhostEvent.EventGhostEvent object at 0x08C54B10>
13:40:24: 0 EventGhost.Pipe.Thread: Named Pipe: Creating pipe
Traceback (most recent call last):
File "EventGhost.pyw", line 53, in <module>
File "C:\Program Files (x86)\EventGhost\eg\__init__.py", line 31, in <module>
import Cli
File "C:\Program Files (x86)\EventGhost\eg\Cli.py", line 172, in <module>
'eg.TriggerEvent, %s' % str(args.startupEvent)
File "C:\Program Files (x86)\EventGhost\eg\NamedPipe.py", line 253, in send_message
return eval(data)
File "<string>", line 1
<eg.Classes.EventGhostEvent.EventGhostEvent object at 0x08C54B10>
^
SyntaxError: invalid syntax- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Can i specify a specific event to activate my macro?
OK it's going to because there are 2 errors taking place. so you need to change the file in the link i posted. as well as the one from here.. because the fix for one bug will cause the second to show it's ugly head. but if you replace both files then all will be good.
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Can i specify a specific event to activate my macro?
@blaher
I don't know if you realized this or not. But you were answering a post from 5 years ago. I just noticed that. LOL I have done it also. It is kinda funny tho. Better late then never??
I don't know if you realized this or not. But you were answering a post from 5 years ago. I just noticed that. LOL I have done it also. It is kinda funny tho. Better late then never??
Re: Can i specify a specific event to activate my macro?
There's quite a few files on that page. Can you tell me which one is relevant, please?kgschlosser wrote: so you need to change the file in the link i posted.
Yeah, I knew because this was how I came across how to generate an event from a batch file in the first place.I don't know if you realized this or not. But you were answering a post from 5 years ago. I just noticed that. LOL I have done it also. It is kinda funny tho. Better late then never??
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Can i specify a specific event to activate my macro?
here is the link to the file
download/file.php?id=5797
replace eg\NamedPipe.py with the one from that link.
download/file.php?id=5797
replace eg\NamedPipe.py with the one from that link.
Re: Can i specify a specific event to activate my macro?
Cheers, it's working without any error now.
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Can i specify a specific event to activate my macro?
hey ya do have to admin I am on top of the ball with getting things fixed.
