Raw Command Edition

Hello!

I would like to get more information on how the user raw commands are defined!

I understand some of the way it has to be written, but I don't really get what everything does: for example, if I put a /S argument, when it's written on the command line, I guess a value is set to 1 and when called, 1 is written instead of the arg name? Am I right?

I would need clarifications on all that, not only the /S option.

As an example, I made a user command for TeraCopy (portable):
the template is : CMD/A/K[,Move]

@nodeselect /dopusscripts\LaunchViaLabel.vbs "SMFSW16G" __DRIVE__\PortableApps\TeraCopy\TeraCopy.exe &CMD& *{allfilepath|filem} {destpath}

When I want to Copy files:
TeraCopy_(Portable) CMD=Copy

When I want to Move files:
TeraCopy_(Portable) CMD=Move

It works the way it's coded, but maybe there are other more convenient solutions to do that.... for applications which handles more or different arguments!

I haven't found a tutorial which tells about it, and the Opus documentation is not that clear on the way to edit these, syntax, etc..

Thanks a lot in advance for your help!

Alright, I'm still trying to understand how all the raw commands arguments does work, but still I have some problems to get everything clear in my head.

Anyways, for that TeraCopy example, I changed it a little so it's more like it should be:
Template: MOVE/S

@nodeselect /dopusscripts\LaunchViaLabel.vbs "SMFSW16G" __DRIVE__\PortableApps\TeraCopy\TeraCopy.exe &MOVE:Move:Copy& *{allfilepath|filem} {destpath}

To Copy:
TeraCopy_(Portable)

To Move:
TeraCopy_(Portable) MOVE

I guess on that particular example, it's better this way (less code as it's really a switch), so I understand pretty well how the /S argument works now.

Once again in this thread as it's related to raw command edition.

A new question about /S in templates.

When I use a switch to make something on the command line to appear, it doesn't seem to work when the no value is null.
Here is how I write it:

&SWITCH:yes:&

I'm not sure if it's correct, there's probably the need of some string in for the no value. I also tried to put a space, but the problem is the same. I end up with the "yes" argument in every case.

How would you code a switch which puts an argument only if set?

Thanks

If you want the 'no' part to be blank then use this:

&SWITCH:yes&

Thanks leo, but it doesn't seem to work:

Here is the command I have, i try to do it on buttons for RoboCopy.

Template: MIROR/S, MOVE/S, EXOLD/S, SOURCE/M/F, DEST/K

/dopusscripts\robocopy.exe &SOURCE& &DEST& &MIROR:/MIR& &MOVE:/Move& &EXOLD:/xo& /e /w:2 /r:2 /v pause

And Here's the code for buttons:

@nofilenamequoting @nodeselect @dironly RoboCopy EXOLD "{filepath$|noterm}" "{destpath$}{filepath$|nopath|noterm}"

@confirm Attention, des fichiers peuvent être effacés! Continuer?|Oui|Non
@nodeselect 
@nofilenamequoting 
@dironly 
RoboCopy MIROR "{filepath$|noterm}" "{destpath$}{filepath$|nopath|noterm}"

There's something I miss somewhere, but I don't know what.
In the first button, /xo is not placed on the command and /MIR is used.

Also, an other problem I have is that when I use the buttons, the command seems to be launched multiple times, I don't know why, and does the same even if with @runonce.

Removing the spaces from the template solves the switches and the multiple-run problem.

I've also changed the SOURCE/M/F into SOURCE/K as /M doesn't seem to work with user commands and AFAIK RoboCopy doesn't let you specify multiple source files (though maybe it does).

Template:

MIROR/S,MOVE/S,EXOLD/S,SOURCE/K,DEST/K

You need to add quotes in the user command, since they seem to be stripped out of user-command arugments.

User command:

/dopusscripts\robocopy.exe "&SOURCE&" "&DEST&" &MIROR:/MIR& &MOVE:/Move& &EXOLD:/xo& /e /w:2 /r:2 /v pause

Finally, you also need to change the buttons so they tell Opus the two file paths are for the SOURCE and DEST arguments. (The source may have been okay without this when it was a /M but since it's now a /K, and the /M didn't seem to work anyway, it has to be explicit. The dest argument always needed to be explicit.)

Buttons:

@nofilenamequoting @nodeselect @dironly RoboCopy EXOLD SOURCE="{filepath$|noterm}" DEST="{destpath$}{filepath$|nopath|noterm}"

@confirm Attention, des fichiers peuvent être effacés! Continuer?|Oui|Non @nodeselect @nofilenamequoting @dironly RoboCopy MIROR SOURCE="{filepath$|noterm}" DEST="{destpath$}{filepath$|nopath|noterm}"

Thanks leo, I think that solved almost all my questions about that!

My biggest problem was probably that beacause of the spaces in templates.
I already tried quotes, and the tip you gave me before without any success mostly because of that.

I should have thought about that, all the commands I made with only one argument as a template worked fine, but not the one with multiple args...

I guess a lot of things will work better now...
Thanks for the great help on this one!