Don't understand the "want" or "need"

When you make new command buttons, and you are doing the files part, I don't understand (and can't find) what the difference between the "want" and "need" is.

ie.:
{file} = want first
{file$} = need first

I was thinking that maybe the want means all files selected, and that need means the first of the files selected.
because I know that if I use the need part, when I have multible files selected, it does each seprately.
ie.: "E:\Program Files\WinRAR\WinRAR.exe" a -df -ep1 -ibck -r -ri5 {destpath}{file$}.cbr {file$}

am I correct in my assumption?

okay, i've noticed something else (glad i was checking things before I posted this) that is:
I'm trying to make a button that does the following:
extracts the files that I have selected into the same directory then deleteing the files that I had selected.
when I have this:
"E:\Program Files\WinRAR\WinRAR.exe" x {allfile} *
or even with {allfile$) it would just do the first file selected.
Which didn't make sense to me, as the description of {allfile} is "Want all"
while the description of {allfile$} is "Need all"

But if I do {file} instead, it actually does all the files. Also, if I change the {file} into {file$} there doesn't appear to be a difference, which is why I'm doing this post.

okay, hope i didn't confuse anyone. I'm dyslexic, so I tend to confuse myself too easily, and well, when I try to explain it, well, no one ever seems to understand. =(

anyways, on my example, this is what I did to get it working how I liked:
sorry, not how i like, as I can't seem to delete the files I had selected, since it seems to unselect them. Not to mention that even though I have the msdos batch thingy on, it runs the delete before it does the winrar.
guess that is a question for another post. (this post: resource.dopus.com/viewtopic.php?p=9222)
but this is the winrar line:
"E:\Program Files\WinRAR\WinRAR.exe" x -o- {file$} *

I was hoping to put this also with it:
Delete FILE FORCE QUIET RECYCLE
but, as i stated above, even with the MSDOS Batch Function, it runs the delete command before the winrar command. I will swear that the point of the msdos batch function was to run the commands 1 at a time. guess i misunderstood.

so, anyways, even though i babbled on, my question still is, what is the difference between the "Want" and "Need"?

oh, and since hopefully you've taken the time to read this, maybe you can tell me if the "all" prefix in the selected files means that it does all the files at the same time, instead of 1 at a time? (ie. {file}, {allfile}, {file$}, {allfile$}

thanks.

1 Like

"Want" means the file(s) will be included if available, but if no files are selected then the command will still run without them. Typically you would use this when launching a program. So you could have a "TextPad" button which launches the program on the selected file, if any, but also click it when no files are selected to open the program on its own.

"Need" means the command will do nothing if you click it without any files selected.

1 Like

great, thank you.
I understand that. make sense. I can see where it would be useful.

okay, then just 1 more quick question,
{file} & {allfile}

does the {file} mean it does it 1 at a time and if so, then that would mean that {allfile} would do all the files at the same time?

thanks for answering my questions, I got things working how I want, but I like to understand the how & why of things.

thanks

Robert

Exactly. Some external commands can only work on one file at a time while others can take a big list of all the files at once, so Opus provides both.

When using the single-file code the command is run again and again, once for each file.

There's also a special @firstfileonly flag which means the button will literally only act on the first selected file.