Order of files passed to button code

If I am not mistaken, there is a problem with Windows, where selected or wildcard-chosen files are not necessarily passed to an application in the correct (meaning: sorted) order. I have seen this most commonly I think, involving the first/last or both files.

Right now, I am trying to access a wildcard selection of files (ie: *.wav) and so far all is going correctly... but for this function to work properly, it needs to be assured that the passed filenames will be in the correct order.

track01.wav
track02.wav
.
.
track10.wav
track11.wav

Can someone tell me whether this is an issue in Opus, ever?

I hope this makes sense. :slight_smile:

I also wonder, if in the future, there will be added a wider variety of dialogs and gui controls. I know this is probably beyond what is expected of Opus, at least right now.

Thanks much...

Bob

Well I see what you want/expect to happen, which is reasonable, but what is actually happening instead?

I know there is a bug in some windows interfaces for a long time that causes (might be wrong about the exact effect but something like...) either the first file to be passed as the last, or vice versa the last selected file to be passed... blah blah blah.

Opus always passes the filenames on the command line in the order they appear in the Lister, what the external program does with them is up to it.

What kind of dialogs do you want?

Hey, Thanks! It is very cool that DOpus does pass in the correct order. Or the 'expected' order. So far my work has shown this, also.

You know, I had some control in mind, but I've forgotten now. However, an information box (like a MessageBox) which could give the user an instruction, and not be modal to the lister.... and only an 'ok' button probably... I'm thinking of one use, which might be an instruction to 'select the files you would like to....' .. things like that. I run across a lot of things that would be nice to have or add to DOpus, it doesn't mean they are terribly important, and I rarely remember them.

I've been working with some regexp renaming, and ran across the fact that a @set var evaluates (properly) in a regular button, but in a batch button it does not (seem to?). I wasn't sure if there is an intentional reason. My interest was to ask via dlgchoose (or other), the extension of the files to act upon. Also, I wondered if there is any reason vars are not evaluated in dialog prompts? It may not be desired all the time, but I see no reason. Say, Delete {$filename}? is never going to be necessary, but evaluating the filename could be useful.

I wondered about the tilde (~) in the regular pattern matching, I could not get it to work the way the docs seem to suggest, nor find an example of using it. I am pretty sure I ran across it's use in one of the mods' button code somewhere, but can't remember. It seems that select pattern ~n and any variant I could think of, always selects all files? I figured how to accomplish the task with a selection, then a select deselect pattern ... though.

Sorry, long post. :slight_smile:

Thanks for everything!

Bob

You could use the following VBScript to do this. The message box is non-modal, although it is also not attached to the Opus window so it'll be hidden (and possibly forgotten about for a long time) if the user clicks on the lister to do stuff.

Call it like this:

MsgBox.vbs "Title of Box" "Body of box. Hello world."

[code]Dim args
set args = WScript.Arguments

if args.Count <> 2 then
MsgBox "MsgBox.vbs: Wrong number of arguments." & vbCRLF & vbCRLF & "Give the title of the message box as the first argument." & vbCRLF & vbCRLF & "Give the body of the message box as the second argument."
WScript.Quit 1
end if

Dim MsgBoxTitle
MsgBoxTitle = args.Item(0)

Dim MsgBoxBody
MsgBoxBody = args.Item(1)

MsgBox MsgBoxBody, vbInformation, MsgBoxTitle[/code]

Seems okay to me. I made this test button, with the MS-DOS Batch Function type:

@set moo = {dlgstring|type something|something} echo {$moo} pause

When I run it it echos whatever I type into the dialog box.

[quote="BobA"]I wondered about the tilde (~) in the regular pattern matching
[...]
It seems that select pattern ~n and any variant I could think of, always selects all files?[/quote]

When using pattern matching ~n will match any file that is not called "n".

If you wanted to match all files that don't start with 'n' then you could use ~(n*)

To match all files that don't contain an 'n' you could use ~(n)

You can also exclude ranges of characters using [~a-z] -- see the Pattern Matching Syntax appendix in the manual for all the rules.

Note Opus supports two types of matching: Pattern Matching and Regular Expressions. I don't think ~ has any special meaning in the context of Regular Expressions. The select command uses Pattern Matching so it's not important here; just thought I'd mention it in case it avoids confusion down the road.

Thank You, Leo. I am working with DOpus sometimes learning, other times just trying to manage some unruly files. :smiley: Also being distracted by family matters and such. Just want to let you know your help is appreciated, even if I don't get back right away.

I've copied your entire last post in this thread to a text file, so I can study it offline. The use of the tilde is mostly what I want to master. I do understand that it does not apply in regex.

Thanks much!

Bob

No problem!