Confused by the filter command "set VIEWFILTER/O"

I am confused by the usage of the command "set VIEWFILTER/O".
Can anyone give me some further tutorials about it?thanks.

I create a new button,and fill the function box with "set VIEWFILTER/O".

You have to add a pattern (something like Set VIEWFILTER *.bmp)
Have a look here (Filter FAQ): [url]]

And also have a look here (online manual):

Thanks for your help.

How do you specify viewing only Files or only Folders with VIEWFILTER?

The View Filter always affects both files and folders, but you can use other filters which only affect one or the other. See here:

HOW TO: Hide all folders from the current window

Thanks, that looks like it should work for my purposes,
but I still can't get a folder to open so that only subfolders are shown in the left display and only files are shown in the right display.
This fails miserably:

<?xml version="1.0"?> <button backcol="none" display="both" textcol="none"> <label>Open c:\</label> <icon1>#newcommand</icon1> <function type="normal"> <instruction>Go c:\ OPENINLEFT</instruction> <instruction>Set FOCUS=left HIDEFILTERFILES=&quot;*&quot;</instruction> <instruction>Go c:\ OPENINRIGHT</instruction> <instruction>Set FOCUS=right HIDEFILTERFOLDERS=&quot;*&quot;</instruction> </function> </button>
Any suggestions?

I'm pretty sure you need to split apart the various Set commands into separate lines like this.


Also, I don't believe that all of those commands will actually work in-succession inside a single toolbar button. There will be race conditions.

If you want to change folders and folder-formats (which include the filters) at the same time, it's best to use either a Layout or a Style.

(Layouts can contain multiple windows. Styles affect just one window.)

That is unless you always want the same things to be filtered out in particular folders, or by default. If you always want it then you can do it using Folder Formats so that it happens automatically whenever you go to particular folders.

[quote="Christiaan"]You have to add a pattern (something like Set VIEWFILTER *.bmp)
Have a look here (Filter FAQ): [url]][/quote]

Say I have many files like

And these in a directory amongst many other files.

I would like to just select say and then create a filter PhoneW*.*

Set VIEWFILTER {file$|noext}.* would give me

How can I set it such that it would show PhoneW*.* and at the same time also ensure that the filter is visible in the FilterBox

Thank you

Try something like this:

Set VIEWFILTER "{dlgstring|Enter Pattern|{file|noext}*}"

[quote="leo"]Try something like this:

Set VIEWFILTER "{dlgstring|Enter Pattern|{file|noext}*}"

This kind of works except that I have to manually edit the filter if say I just want the first 6 characters of the selected file's name.

Besides this, is it possible to then Make both Panes have identical Filters ?

You want Opus to psychically guess how much of the filename is important? :slight_smile:

Not really to guess.

I just want it to pick the first 6 characters so that I can see all the files that match the first 6 characters for example.

Otherwise with the existing command, I would be seeing Phoneweaverlite.* if I had selected the 1st file.

What I like to have is the filter appear as Phonew.* and as a next step, also have the same filter for both the left and right pane.