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.

Having a problem with a simple test of EG

If you have a question or need help, this is the place to be.
Post Reply
Chris Dancer
Posts: 2
Joined: Mon Jan 28, 2013 6:46 pm

Having a problem with a simple test of EG

Post by Chris Dancer »

I've just started playing with EventGhost. I just set up a simple test using an event from a button press on a Logic3 media remote to open an instance of Notepad and type some text. When I press the button Notepad opens but the text does not appear. And yes, I have tried "Use alternate method...".

What am I missing here?

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1610" Guid="{9E3D5CF2-6328-4175-95AB-983605D73092}" Time="1359398439.83">
<Autostart Name="Autostart" Expanded="True">
<Plugin Identifier="HID" Guid="{05A690D9-27C2-4AC5-B0DD-2F562619E922}" File="HID">
gAIoWAAAAABxAIiJiVVeXFw/XGhpZCN2aWRfOTk5OSZwaWRfMDEwMSZtaV8wMSZjb2wwMyM3JjM4OGY3ZGQ4JjAmMDAwMiN7NGQxZTU1YjItZjE2Zi0xMWNmLTg4Y2ItMDAxMTExMDAwMDMwfXEBTZmZWBIAAABSYXl0YWMgQ29ycG9yYXRpb25xAk0BAVgaAAAAV2lyZWxlc3MgVVNCIERldmljZSAoMi40RylxA00BAYlLAHRxBC4=
</Plugin>
</Autostart>
<Macro Name="Play button" Expanded="True">
<Event Name="HID.Button.22" />
<Action>
System.Execute(u'C:\\WINDOWS\\notepad.exe', u'', 0, False, 2, u'', False)
</Action>
<Action>
Window.FindWindow(u'Notepad.exe', None, None, None, None, 1, False, 5.0, 0)
</Action>
<Action>
Window.SendKeys(u'Hello world!{Enter}', False)
</Action>
</Macro>
</EventGhost>
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Having a problem with a simple test of EG

Post by Pako »

You are sending the keystrokes to the wrong window.
Try this:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1610" Guid="{B08BD46D-46AF-48BA-847A-C26BB228943A}" Time="1359400181.16">
    <Autostart Name="Autostart" Expanded="True">
        <Plugin Identifier="HID" Guid="{05A690D9-27C2-4AC5-B0DD-2F562619E922}" File="HID">
            gAIoWAAAAABxAIiJiVVeXFw/XGhpZCN2aWRfOTk5OSZwaWRfMDEwMSZtaV8wMSZjb2wwMyM3JjM4OGY3ZGQ4JjAmMDAwMiN7NGQxZTU1YjItZjE2Zi0xMWNmLTg4Y2ItMDAxMTExMDAwMDMwfXEBTZmZWBIAAABSYXl0YWMgQ29ycG9yYXRpb25xAk0BAVgaAAAAV2lyZWxlc3MgVVNCIERldmljZSAoMi40RylxA00BAYlLAHRxBC4=
        </Plugin>
    </Autostart>
    <Macro Name="Play button" Expanded="True">
        <Event Name="HID.Button.22" />
        <Action>
            System.Execute(u'C:\\WINDOWS\\notepad.exe', u'', 0, False, 2, u'', False)
        </Action>
        <Action>
            Window.FindWindow(u'notepad.exe', None, u'Notepad', u'', u'Edit', 1, False, 5.0, 0)
        </Action>
        <Action>
            Window.SendKeys(u'Hello world!{Enter}', False)
        </Action>
    </Macro>
</EventGhost>
Pako
Chris Dancer
Posts: 2
Joined: Mon Jan 28, 2013 6:46 pm

Re: Having a problem with a simple test of EG

Post by Chris Dancer »

Cool! But not exactly intuitive, at least, not to a non-Windows programmer!

Of course in reality I will be using programs other than Notepad, so for any given program how would I find out the correct settings for window class, child name and child class?
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Having a problem with a simple test of EG

Post by Pako »

Chris Dancer wrote:... so for any given program how would I find out the correct settings for window class, child name and child class?
There is no universal guidance for it.
The only known method is trial and error.
And in some cases it is even impossible to correct window (child) to find.

Pako
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Having a problem with a simple test of EG

Post by krambriw »

Well, you could try

1) Open the program(s) you are interested in and leave it running in a window

2) In EG, create a new macro for "Find a Window" and use the specific finder pointer and move it over your previously opened program, then hopefully, the details will be captured and filled in for you automatically

3) Repeat until all programs of interest are covered

BestR Walter
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Having a problem with a simple test of EG

Post by Pako »

krambriw wrote:Well, you could try

1) Open the program(s) you are interested in and leave it running in a window

2) In EG, create a new macro for "Find a Window" and use the specific finder pointer and move it over your previously opened program, then hopefully, the details will be captured and filled in for you automatically

3) Repeat until all programs of interest are covered

BestR Walter
I considered it for granted, so I did not write it here. :)

Pako
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Having a problem with a simple test of EG

Post by krambriw »

:oops:
Post Reply