Page 1 of 2
Windows Command Line
Posted: Fri Dec 19, 2014 9:43 pm
by tominator007
Would be cool to have a plugin that can pass windows command line. For example, I use Evernote and would like to pass info directly to it from triggered events using EventGhost. An example would be "evernote.exe /Task:PasteClipboard /Task:SyncDatabase". This .bat file passes the clipboard contents to Evernote and automatically syncs with the cloud service upon an EG trigger.
I have a bunch of simple .bat files that trigger upon an EG event.
Just thought it would be nice to be able to this directly within EG instead of having a bunch of .bat files to keep track of. I know this sounds contradictory to py but is this possible?
thanks
Dave
Re: Windows Command Line
Posted: Sat Dec 20, 2014 12:05 am
by jonib
tominator007 wrote:Just thought it would be nice to be able to this directly within EG instead of having a bunch of .bat files to keep track of. I know this sounds contradictory to py but is this possible?
I must be missing something. You are running .bat files based on events in EventGhost, why can't you run evernote instead of the .bat files?
I assume you are using the "Start application/program" action?
jonib
Re: Windows Command Line
Posted: Sat Dec 20, 2014 7:18 am
by tominator007
Sometimes when I'm working on a job (freelance), I have to do a lot of repetitive actions, like copying/pasting or creating notes in Evernote. Right now, I'm working a job that I have to do 100s of copying/pasting operations. It's just easier to use EG to speed up the process.
And yes, I'm using the "Start application/program" action to start the .bat files and clipboard content change as a trigger.
It's definitely not something that I can't live without, but I just thought it would be cool to run windows command line from within EG and not to have so many .bat files to keep track of.
I got the idea from a Vuze plugin called Command Runner, which basically just runs a command line when something's finished downloading. I thought that maybe something similar could be implemented in EG.
Btw, love this program, EG. Pretty cool.
thanks
Dave
Re: Windows Command Line
Posted: Sat Dec 20, 2014 12:30 pm
by jonib
tominator007 wrote:And yes, I'm using the "Start application/program" action to start the .bat files and clipboard content change as a trigger.
So why cant you run Evernote instead of the bat file with the "Start application/program" action?
jonib
Re: Windows Command Line
Posted: Sun Dec 21, 2014 5:29 am
by tominator007
I prefer to use Evernote as a background process and automated with EG instead of going thru the motions (manually opening EN and creating a new note) for repetitive tasks.
But using Evernote via EG and a .bat file was just one example.
No biggie.
Thanks
Re: Windows Command Line
Posted: Sun Dec 21, 2014 6:41 am
by Pako
Can you explain in other words, what you actually need?
Can you give us any other examples?
At this moment I do not understand what you want.
Pako
Re: Windows Command Line
Posted: Sun Dec 21, 2014 7:41 am
by tominator007
In EG you can add an action, Python Command -- Executes a single Python statement.
Was just wondering if a Windows Command action could be added. It would look something like this:
https://www.dropbox.com/s/wkkj7onr6clo4 ... e.png?dl=0
I modified a Python Command action dialog box.
-Dave
Re: Windows Command Line
Posted: Sun Dec 21, 2014 2:25 pm
by jonib
tominator007 wrote:Was just wondering if a Windows Command action could be added. It would look something like this:
Using "Start application/program" action you can use any Windows command, that's where my confusion is, and why I repeatedly asked why you can't use it to run Evernote directly. If you can run it through a .bat file you should be able to run it via "Start application/program" action.
edit: You can attach images directly in the post.
jonib
Re: Windows Command Line
Posted: Sun Dec 21, 2014 3:41 pm
by Pako
Now I understand.
You can still use the action "Start Application" as follows:
But even so, it would be advantageous if there will be also a new action "Windows Command".
It can also return any results (in contrast to the action "Start Application"). I will add this new action to the next EventGhost build.
However, for launching executables will still preferred the action "Start Application".
Pako
Re: Windows Command Line
Posted: Sun Dec 21, 2014 4:29 pm
by tominator007
Oh, crap. I didn't see that.
Thanks for all the replies and sorry for taking up your time.
-Dave
Re: Windows Command Line
Posted: Sun Dec 28, 2014 3:03 pm
by Pako
I've added a new action
Windows Command to
new EventGhost release.
This is a bit different, than the action
Start Application:
- Here you can also start internal windows commands (such as Dir, Del, Move, Set ...)
- This action returns the results
Pako
Re: Windows Command Line
Posted: Sun Dec 28, 2014 4:51 pm
by Sem;colon
Nice, this makes working with the command line much more convenient!
...If it works

I'm getting the following ERROR:
OS: German Win 8.1 Pro (x64)
Re: Windows Command Line
Posted: Sun Dec 28, 2014 5:29 pm
by Pako
Sem;colon wrote:...If it works
I assure you that for me it works.
Even if I change line 77 as follows:
data = data.decode ("cp850"),
it works also well (but incorrectly decoded).
Can you please do the following test:
Code: Select all
s850 = '\x84\x81\x8e\x9a'
print s850.decode("cp850")
Pako
Re: Windows Command Line
Posted: Sun Dec 28, 2014 8:46 pm
by Sem;colon
Hi Pako,
.decode("cp850") works.
I did a bit more debugging and it seems that the variable cp is "cp850." on my system.
If I remove the "." with
Code: Select all
cp = "cp" + data.split()[-1].replace(".","")
in line 73 it works.
I think the same needs to be done in line 105.
Re: Windows Command Line
Posted: Mon Dec 29, 2014 7:07 am
by Pako
Yes, that's clear. Once again surprise from MS$.
In my case, it looks different - no dot:
Your solution with the replace, it is correct in this case.
But I am afraid that it may not be correct in all cases ...
If any other user will not report another case, I can use your solution.
Pako