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.

Open directory.

If you have a question or need help, this is the place to be.
Post Reply
specter333
Experienced User
Posts: 95
Joined: Thu Dec 27, 2007 12:26 am

Open directory.

Post by specter333 »

Here's something I thought would be easy, silly me.

I simply want to open a directory with EG. I've been doing it by having EG run Autohotkey scripts but the more I learn about EG the less I rely on AHK. Example, in AHK the command to open the c drive is,

Code: Select all

Run, c:
I thought the Python command would be just as simple but so far, after a couple of hours doing web searches, its eluded me. Can someone show me what I'm missing. thanks
CollinR
Experienced User
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma
Contact:

Re: Open directory.

Post by CollinR »

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1431">
    <Macro Name="Start Explorer at root">
        <Action>
            System.Execute(u'C:\\WINDOWS\\explorer.exe', u'c:', 0, False, 2, u'')
        </Action>
    </Macro>
</EventGhost>
It's not that much more difficult.

If you can't figure out after you have looked at that just tell me which directory you would like.
specter333
Experienced User
Posts: 95
Joined: Thu Dec 27, 2007 12:26 am

Re: Open directory.

Post by specter333 »

Wow, that's quite a bit more in depth than Just "Run" and of course way over my head. I'm guessing I would copy that into a "Python Script" macro correct? When I do I get these error messages,
  • Error compiling script.
    Traceback (most recent call last):
    SyntaxError: invalid syntax (12, line 1)
If you could show me a couple of examples, a drive and a folder, I'll try to figure it out from there.
  • 1. Open C:/
    2. Open C:/X10
Thanks again
CollinR
Experienced User
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma
Contact:

Re: Open directory.

Post by CollinR »

All you ~should~ need to do is copy/paste that anywhere in your config tree as a regular macro.

It's not a python script it makes use of the "Launch Application" action from the System plugin that comes with EventGhost. The application it launches is explorer.exe (Windows Explorer) with a command line argument of c: which is simply telling the windows explorer to start and looking in C:.

It looks as it does as that is a snippet of XML taken directly from inside EventGhost, thats right copy/paste works everywhere here. :D

To make it show C:\X10 then you would only change the command line argument.

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1431">
    <Macro Name="Start Explorer at C:\x10">
        <Action>
            System.Execute(u'C:\\WINDOWS\\explorer.exe', u'c:\x10', 0, False, 2, u'')
        </Action>
    </Macro>
</EventGhost>
If you look at how thats broken down you can easily fogure this out. This is the XML config, the backend of EventGhost.

<?xml version="1.0" encoding="UTF-8" ?>

XML crap, this is prepended to anything you copy in EventGhost.

<EventGhost Version="1431">

Obvious, also automatically prepended when coping.

<Macro Name="Start Explorer at C:\x10">
This is a macro

<Action>
System.Execute(u'C:\\WINDOWS\\explorer.exe', u'c:\x10', 0, False, 2, u'')
</Action>

This is an action inside your macro.

</Macro>

End of macro

</EventGhost>

End of config
specter333
Experienced User
Posts: 95
Joined: Thu Dec 27, 2007 12:26 am

Re: Open directory.

Post by specter333 »

Ok got it, thanks again for your help. I forgot that you could paste right into the tree. It's not hard at all once I see how that fills in to the "Open Application" macro.

For any other newbies reading this here is an example of how it works.
ex1.jpg
specter333
Experienced User
Posts: 95
Joined: Thu Dec 27, 2007 12:26 am

Re: Open directory.

Post by specter333 »

Strange thing I just noticed. When I open the desktop folder from EG not everything appears in the folder. Some of the things missing are the recycle bin, My Computer, My Network Place, My Documents, Internet Explorer and some of the shortcuts added by programs.

When I open it with a shortcut from a tool bar or from an AHK script then everything is there. I use the same path in all three places,

Code: Select all

"C:\Documents and Settings\Rich\Desktop"
any idea what's up with that?
CollinR
Experienced User
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma
Contact:

Re: Open directory.

Post by CollinR »

Desktop and start menu are different as the stuff is actually in 2 places.

C:\Documents and Settings\Rich\Desktop
C:\Documents and Settings\All Users\Desktop

C:\Documents and Settings\Rich\Start Menu
C:\Documents and Settings\All Users\Start Menu
specter333
Experienced User
Posts: 95
Joined: Thu Dec 27, 2007 12:26 am

Re: Open directory.

Post by specter333 »

Ok, but when I open the all users menu all I get is the shortcuts created by applications, still not everything that's on my desktop. This is not a big deal though since I can work around with an AHK script. Now I only have to make one script for the desktop instead of one for every drive or folder I want to open. I'm probably the only person that doesn't show the desktop on the desktop anyway. Thanks again Collin, you've been a big help. Rich
Post Reply