Group by file type group

Hello,

How do I group files in lister by file type group?

I don't think there is a file type group column built in, so you'd need a script to supply the column, which would then let you group by it.

Note that the same file may be in more than one group, if the groups overlap.

@Leo
How would I access the DO filetype group of an item in a script?
I'd say it's not possible, but as I may not have the full overview, I'd also enjoy being wrong. o)

Looks like Item --> Groups will do what you are after. Per the Help..

Returns a Vector of strings containing the names of any and all file type groups that this file is a member of.

Regards, AB

I seeked through the properties and metadata before, but did not see this one! Cool! o)
So, let's have a file type group script column! o)

Just one remark - filetype groups' names returned by API are not localised.
It would be nice if they were.

@Xyzzy
So you get human readable text at least? o) All I get are GUIDs..

var groups = ""; var item = DOpus.FSUtil.GetItem("C:\\.fsop_redobatch.bat"); for(var i=0;i<item.groups.length;i++){ groups += (""+item.groups(i)); if (i+1<item.groups.length) groups += " + "; } DOpus.Output("Groups: " + groups);
Output:

Groups: {8F3C8009-BD6C-4984-9A57-8A6F5C5D1DB0}

Any idea?! o)

I need to correct myself, I do not get GUIDs for all file type groups, it's for the custom (not builtin?) groups only.
Watch this (group names/GUIDs are cut in the column):


My code behind is something like this:

function (data) { if (data.item.is_dir){ data.value = "Folders"; return; } var groups = ""; var item = data.item; for(var i=0;i<item.groups.length;i++){ groups += (""+item.groups(i)).substring(0,10); if (i+1<item.groups.length) groups += " + "; } data.value = groups; }
In case there's something I can do about it, please let me know, thanks! o)

In the next version we'll add a display_name property to get the display name of the group.

1 Like

Thanks in advance! o)

This is in beta 11.17.4.

It works! Thanks! o)
CustomGrouping (group by SizeRange/FileTypeGroup..): Columns: CustomGrouping (group by SizeRange/FileTypeGroup..)

Hi guys, very new to this tool (just transition from Mac OS pathfinder...). I love Directory Opus...
Is there a way to set the "Group by type" as a default option so every time I open a new lister the files/folders are grouped by type? Cannot find this option.
Thanks!

You are looking for Folder Formats.

Fantastic! Thanks.

See the FAQ for instructions on how to make all your folders look the same (if that's what you want).