Group files by Kind?

For some reason, one of the most useful column items is missing from Dopus... Which I'm finding incredibly awesome and useful, by the way. But one of the most common things for me to do with my important folders in Explorer is to Group By: Kind (one of the hidden by default column categories... also usable in Windows Search, fyi). It's way more useful than grouping by Kind, as Png, Jpg, Bmp files are all grouped together under Image Files instead of being separated... But for some reason this column category isn't included in Dopus' Folder Options dialog... Is there some reason this is available in regular Windows Explorer but not Dopus?

You can do this (and have full control over the categories and what file types belong to each) by creating Labels based on File Type Groups.

I see. I might do that as it sounds better anyways, still curious though as to why this isn't an option available in Dopus, seeing as it's very simple to use and seems to be a standard Windows explorer categorization.

Also, I seem to be able to create these labels but I have no idea how to view them as grouped by these label filters...

So you assigned the labels, but you don't know how to use them to group?

Just add the Label column do your lister, right-click the column header, and choose "group".

You can add the shell's Kind column to Opus using a script (now that you've upgraded to Pro, that is :slight_smile: )

Download the attached file and drag it into the list of scripts in Settings / Preferences / Toolbars / Scripts. You'll then find the Kind column under the Script category, and will be able to group by it just like in Explorer.

The script code is shown here for reference:

[code]option explicit

' Kind Column
' (c) 2017 jpotter

' This is a script for Directory Opus.
' See for development information.

' Called by Directory Opus to initialize the script
Function OnInit(initData) = "Kind Column"
initData.version = "1.0"
initData.copyright = "(c) 2017 jpotter"
' initData.url = ""
initData.desc = "Adds a column displaying a file's kind"
initData.default_enable = true
initData.min_version = "12.0"

Dim col

Set col = initData.AddColumn = "Kind"
col.method = "OnKind"
col.label = "Kind"
col.justify = "left"
col.autogroup = true

End Function

' Implement the Kind column
Function OnKind(scriptColData)
scriptColData.value = scriptColData.item.ShellProp("System.KindText", "R")
End Function
Kind Column.vbs.txt (898 Bytes)

Jon & I both wrote scripts at the same time. Mine will do a bit more if you want to wait for it. I'm just writing up a post for it.

I've posted mine to Column: Kind and File Type Group.

Main differences:

[ul][li]Handles things which match multiple Kinds in the same way as Explorer. So "Link; Folder" (shortcut to a folder) will be grouped under Links, not in a separate "Link; Folder" group. The column will still display "Link; Folder" with the full information.

[li]Also has a column for Opus's own File Type Groups, which you may prefer if you want to edit the mappings between file types and groups/kinds.[/li][/ul]

There are a few other minor diffs, but those are the main ones.

Nice script Leo, thanks. That "File Types Group" column is much better than the Labels approach since a file's Label can be overridden by its Status.

Thanks, that works great. :smiley:

I do get the following error though, although it still seems to work fine so I'm not too concerned...

1/6/2017 2:23 PM Kind Columns: Error at line 83, position 2 1/6/2017 2:23 PM Kind Columns: Error 0x80070715

Is there a particular (type of) file or folder that seems to cause the error message? I haven't been able to find one which does it so far.

Nice work, I'm sure I'll find this useful.

I also got the error messages:

This was last night, and I haven't been able to recreate them today, but will report back if it happens again...

v12.3.1 x64

When I was testing this, I first noticed that 1 of 3 .exe's did not show up in the Program group (it was placed under Unknown). I then noticed that I also got the same errors as above.

Error at line 83, position 2 Error 0x80070715
I then tried on a different drive root and I did not get the error.

I copied the "unknown" .exe to the second drive for testing, I then got the same error.

The file in question is dMC-R16.1-Ref-Trial.exe. You can download from

Many thanks!

This turns out not to be something the script itself can work around. I've had to make a code change for it instead. It'll be part of the next beta.

There's a new v1.1 of the script here.

(I've deleted my previous post about editing the script by hand. No need to do this with the new version.)

It will now display "" in the Kind column if it cannot be populated.

In Opus 12.3.2, it will still fail on files like the one from ktbcrash's post above, but it'll just display "" instead of triggering the flashing red icon.

Once Opus 12.3.3 is out, it should no longer fail on those files (but may still show "" in other situations; e.g. if the file cannot be accessed at all).

v1.1 of the script also fixes a problem with user-defined file type groups which is discussed in the other thread.

I'm late to the party, but still like to mention the CustomGrouping column set I maintain for some time.
It already has/had the FileTypeGroup column: Columns: CustomGrouping (group by SizeRange/FileTypeGroup..)

I added the "Kind" column to that set as well. Hope you don't mind me stealing your code. o) It's just to keep belonging things together (for me), others might prefer specific addins for 1 or 2 columns only, but my script addins folder explodes. What version you choose is.. up to you. o)