Sort by Tag Length?

Save ColumnTagCount.js.txt to

%appdata%\GPSoftware\Directory Opus\Script AddIns

Toggle column with

Set COLUMNSTOGGLE="scp:TagCount/TagCount(!,a,0)"
JScript
function OnInit(initData) {
    initData.name = 'TagCount';
    initData.version = '2023-05-22';
    initData.copyright = 'https://resource.dopus.com/t/sort-by-tag-length/44464';
    initData.default_enable = true;
    initData.min_version = '12.0';
}

function OnAddColumns(addColData) {
    var col = addColData.AddColumn();
    col.name = 'TagCount';
    col.method = 'OnColumn';
    col.justify = 'right';
    col.type = 'number';
}

function OnColumn(scriptColData) {
    if (!scriptColData.item.metadata) return;
    if (!scriptColData.item.metadata.tags) return;
    scriptColData.value = scriptColData.item.metadata.tags.count;
}

https://resource.dopus.com/t/how-to-use-buttons-and-scripts-from-this-forum/3546

2 Likes