Custom commands

For tips and help on how to customize various aspects of muCommander.

Re: Custom commands

Postby Vrho » Thu Aug 28, 2008 12:52 pm

Hi,

me again...
one problem solved:
Now Open with... is functioning (not greyed anymore) - it seems like it is very important how the commands.xml file is writen
The code:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
   <commands>
      <command alias="Emacs" value="C:\Program Files\Emacs\bin\runemacs $f"/>
   </commands>

doesn't work because of the space before <commands>

The code:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<commands>
   <command alias="Emacs" value="C:\Program Files\Emacs\bin\runemacs $f"/>
</commands>

enables Open with..


but when I run for example Emacs or any other program to open file with I get an error message: An error has ocured while performing the requested operation.
The path to runemacs scrtipt is C:\Program Files\Emacs\bin\ and the code in commands.xml is as written above.

Seems like the "value" is not right. At least for WinXP.

Thanks for help,
Vrho
Vrho
 
Posts: 3
Joined: Sun Aug 24, 2008 5:05 pm

Re: Custom commands

Postby Nicolas » Thu Aug 28, 2008 1:02 pm

Hey,

First, to fix your problem: the \ character has a special meaning in commands, it will escape the following character.
In order to have an actual \ in a command, you need to double it. For example:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<commands>
   <command alias="Emacs" value="C:\\Program Files\\Emacs\\bin\\runemacs $f"/>
</commands>


This should work - it does on my XP anyway.

On the other hand, I'm very confused with your space issue. Are you absolutely positive that this was the only difference between your two files? I just tried to reproduce the problem and haven't been able to..

Nicolas
User avatar
Nicolas
 
Posts: 831
Joined: Mon Oct 02, 2006 10:36 pm
Location: France

Re: Custom commands

Postby Vrho » Thu Aug 28, 2008 7:30 pm

Hi,

Yes I'm positive the problem with commands.xml was that the <commands> line didn't start at the begining of line. Except if there is any problem with editing the commands.xml with Dreamweaver (program I used to edit).

Thank you very much!... the thing with duble \ solved my error. :)

Keep up the good work!

Vrho
Vrho
 
Posts: 3
Joined: Sun Aug 24, 2008 5:05 pm

Re: Custom commands

Postby hamoid » Thu Apr 16, 2009 12:17 pm

Hi! I think I need help :) I spent the last hour trying to achieve something but no success. I'm on OS X. This is how it looks at the moment:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<commands>
    <command alias="SetForCompare"  value="perl /Users/abe/Downloads/my\ scripts/SetForCompare.pl $f" display="Set for comparing" />
    <command alias="DoCompare" value="/Applications/DeltaWalker.app/Contents/MacOS/DeltaWalker -nosplash $f &#96;cat /tmp/compare.txt&#96; &amp;" />
</commands>


SetForCompare: I had to use perl because I could a simple "echo $f >/tmp/compare.txt" would not work. Why?
I also tried with &gt; instead of >, I tried adding bash in front. I tried lots of things :)

DoCompare: this is not working. DeltaWalker is complaining about this: The files '`cat' and '/tmp/compare.txt`' cannot be opened.
So it looks like the back ticks are not working, but they do using the command line. I think muCommander is maybe splitting the
string using spaces, and sending each part as an argument to DeltaWalker? I could do it again in perl...

But isn't there a simpler way without using perl? I just want two commands:
1. save current path to a text file.
2. trigger DeltaWalker with two parameters: a) currently selected file, and b) file path saved in step 1.

Thanks for superMu =)
hamoid
 
Posts: 8
Joined: Fri Jun 08, 2007 3:35 pm
Location: Berlin

Previous

Return to Pimp my commander

Who is online

Users browsing this forum: No registered users and 1 guest

cron