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.

Event parameters?

If you have a question or need help, this is the place to be.
Post Reply
Cheatah
Posts: 2
Joined: Tue Mar 17, 2009 2:04 pm

Event parameters?

Post by Cheatah »

When I use for example the Directory Watcher, I get events like these to show up in the log:
"DirectoryWatcher.Updated (u'C:\\Users\\jand\\Desktop\\paul.dll',)"

Is there a way in a macro to check what file was updated?

What I want to do is: when a .rar file is put into a certain directory, EventGhost should start an unrar program with the name of the file as a command line parameter so it unrars that specific file.
User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: Event parameters?

Post by jinxdone »

http://www.eventghost.org/wiki/Scripting

DirectoryWatcher.Updated (u'C:\\Users\\jand\\Desktop\\paul.dll',)

The bit in bold is what's known as event payload. You can access it from a python script/command by using the eg.event.payload variable. Note that you can also trigger events from inside python scripts with the eg.TriggerEvent(), which is often useful.

And yep, the unraring script should not be difficult to make, have fun coding. :)
Cheatah
Posts: 2
Joined: Tue Mar 17, 2009 2:04 pm

Re: Event parameters?

Post by Cheatah »

Thanks for your fast reply! Got it working with a minimum of Python scripting...
merdok1981
Posts: 8
Joined: Wed Dec 16, 2009 12:53 am

Re: Event parameters?

Post by merdok1981 »

Any chance you could share your code for this? I've no clue how to code in Python so it would be a great help. :)
Post Reply