Using the {allfilepath$} keyword

Don't know if this is by design but:
I have a program that reads a text file by passing the argument -File=
I defined a button as follows: "C:\programname.exe" -File={allfilepath$}

I couldn't understand why the file was not being opened until I discovered this:
If the filename did NOT have any spaces in it, {allfilepath$} returned -File=filename
If the filename did have spaces in it, {allfilepath$} returned -File= filename
(notice the space after the "=" and before the file name)

The program opened the file ONLY if there was no space after the "=". I admit it was a poorly written program that should have accounted for this (I wrote it) but nevertheless maybe it shouldn't occur. The (allfile$} parameter also shows this behavior.

Just wanted to point this out because it took me quite a while to figure out what was going on and it could save someone else some time.

Bob Gregory

Can the program open multiple files that way?

It doesn't look like that command line syntax would take more than one filename.

If it only works with one filename, use {filepath$} instead of {allfilepath$}. (By default, Opus will then run the program once for each file if more than one is selected.)

Thanks Leo. Yes it does work with multiple file names. I was just wondering why there was a blank before the first file name. I can understand a blank afterwards. Not a problem now that I know this happens.

I think it's due to the way quotes are added automatically when needed (by default), and the expectation that {allfilepath$} will be used somewhere that each filename is a separate, space-separated argument.