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.

Windows Command Line

Got a good idea? You can suggest new features here.
tominator007
Posts: 5
Joined: Fri Dec 19, 2014 9:31 pm

Windows Command Line

Post 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
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Windows Command Line

Post 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
XBMC2 plugin to control XBMC. If you want to flatter me Image
tominator007
Posts: 5
Joined: Fri Dec 19, 2014 9:31 pm

Re: Windows Command Line

Post 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
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Windows Command Line

Post 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
XBMC2 plugin to control XBMC. If you want to flatter me Image
tominator007
Posts: 5
Joined: Fri Dec 19, 2014 9:31 pm

Re: Windows Command Line

Post 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
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Windows Command Line

Post 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
tominator007
Posts: 5
Joined: Fri Dec 19, 2014 9:31 pm

Re: Windows Command Line

Post 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
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Windows Command Line

Post 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
XBMC2 plugin to control XBMC. If you want to flatter me Image
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Windows Command Line

Post by Pako »

Now I understand.
You can still use the action "Start Application" as follows:
StartProgramCmd.png
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
tominator007
Posts: 5
Joined: Fri Dec 19, 2014 9:31 pm

Re: Windows Command Line

Post by tominator007 »

Oh, crap. I didn't see that.
Thanks for all the replies and sorry for taking up your time.
-Dave
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Windows Command Line

Post 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
Sem;colon
Plugin Developer
Posts: 625
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Windows Command Line

Post by Sem;colon »

Pako wrote:I've added a new action Windows Command to new EventGhost release.
Nice, this makes working with the command line much more convenient!

...If it works ;-)
I'm getting the following ERROR:
cmd.PNG
OS: German Win 8.1 Pro (x64)
If you like my work, Image me a drink :wink:
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Windows Command Line

Post 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")
PyCrust-CP850.png
Pako
Sem;colon
Plugin Developer
Posts: 625
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Windows Command Line

Post 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.
If you like my work, Image me a drink :wink:
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Windows Command Line

Post by Pako »

Yes, that's clear. Once again surprise from MS$.
In my case, it looks different - no dot:
chcp.png
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
Post Reply