This script adds support for creating custom columns using regexp against the file name and path. The columns are configured using a dialog, with all Dopus column types and custom column settings being supported.
Example output
The first column are the actual folders, the rest are RegExp extracted columns from the folder name.
Column config for above example
Normally you would create the columns using the dialog, however to try the above example you can paste the below config in to global variable RegexpCustomColumnsConfig global-variable-management-dialog.
Folder Names
photo shoot - black cat 4 - 2017-01-01 - 20
photo shoot - cat 2 - 2017-10-01 - 100
photo shoot - cow 5 - 2016-01-02 - 100
photo shoot - ginger cat 4 - 2016-12-01 - 95
photo shoot - max 3 - 2016-12-02 - 100
photo shoot - puppy 1 - 2017-01-01 - 75
Column config
{
"columns": [
{
"name": "Shoot Date",
"displayName": "RegExp Sample 2",
"nogroup": true,
"nosort": true,
"datetimeformat": "yyyy-mm-dd",
"regexp": "(.*?)(\\d\\d\\d\\d-\\d\\d-\\d\\d).*",
"captureGroup": "\\1\\2",
"returnTheFirstNonEmptyGroup": false,
"type": "date",
"defwidth": "20",
"skipEmptyCaptureGroup": true,
"justify": "right",
"inputItemProperty": "name",
"filter": "All",
"firstValid": false,
"label": "Shoot Date",
"header": "Shoot Date",
"maxstars": "",
"grouporder": "",
"sorting": "normal",
"infotiponly": false,
"output": "$2"
},
{
"name": "Shoot Rating",
"displayName": "RegExp Sample 3",
"nogroup": true,
"nosort": true,
"datetimeformat": "yyyy-mm-dd",
"regexp": ".*?\\s-\\s.*?\\s(\\d)",
"captureGroup": "",
"returnTheFirstNonEmptyGroup": false,
"type": "stars",
"defwidth": "10",
"skipEmptyCaptureGroup": false,
"justify": "right",
"inputItemProperty": "name",
"filter": "Folders",
"firstValid": true,
"label": "Shoot Rating",
"header": "Shoot Rating",
"maxstars": "5",
"grouporder": "",
"sorting": "normal",
"infotiponly": false,
"output": "$2"
},
{
"name": "Shoot Processed Relative",
"displayName": "RegExp Sample 1",
"nogroup": false,
"nosort": false,
"datetimeformat": "yyyy-mm-dd",
"regexp": ".*?(\\d{2,3})$",
"captureGroup": "0",
"returnTheFirstNonEmptyGroup": false,
"type": "graph",
"defwidth": "20",
"skipEmptyCaptureGroup": false,
"label": "Shoot Processed Relative",
"header": "Shoot Processed Relative",
"maxstars": "5",
"justify": "left",
"grouporder": "",
"sorting": "normal",
"infotiponly": false,
"output": "",
"firstValid": true,
"inputItemProperty": "name_stem",
"filter": "All"
},
{
"name": "Shoot Subject",
"label": "Shoot Subject",
"header": "Shoot Subject",
"type": "text",
"defwidth": "20",
"justify": "left",
"infotiponly": false,
"maxstars": "5",
"datetimeformat": "yyyy-mm-dd",
"noGroup": false,
"grouporder": "",
"sorting": "normal",
"regexp": ".*?\\s-\\s(.*?)\\s\\d",
"inputItemProperty": "name",
"firstValid": true,
"output": "$1",
"filter": "Folders",
"nogroup": false
},
{
"name": "Shoot Processed",
"label": "Shoot Processed",
"header": "Shoot Processed",
"type": "percent",
"defwidth": "20",
"justify": "left",
"infotiponly": false,
"maxstars": "5",
"datetimeformat": "yyyy-mm-dd",
"noGroup": false,
"grouporder": "",
"sorting": "normal",
"regexp": ".*?(\\d{2,3})$",
"inputItemProperty": "name_stem",
"firstValid": true,
"output": "",
"filter": "All",
"nogroup": false
},
{
"name": "Shoot Friendly Name",
"label": "Shoot Friendly Name",
"header": "Shoot Friendly Name",
"type": "text",
"defwidth": "20",
"justify": "left",
"infotiponly": false,
"maxstars": "5",
"datetimeformat": "yyyy-mm-dd",
"noGroup": false,
"grouporder": "",
"sorting": "normal",
"regexp": ".*?\\s-\\s(.*?)\\s\\d\\s-\\s(\\d{4}-\\d{2}-\\d{2})\\s-.*",
"inputItemProperty": "name_stem",
"firstValid": false,
"output": "$1 - on $2",
"filter": "Folders",
"nogroup": false
}
]
}
How to use
-
Download the attached .osp file (below) and drag it to the list in Preferences / Toolbars / Scripts.
(Alternatively, drag it into into your Script AddIns folder
/dopusdata/Script AddIns
, which does the same thing.) -
Use the provided button (below) to display the dialog and create you columns.
-
Once the columns are created you will need to add them to your Lister like you would any other Dopus Column.
-
The apply changes button, will live update the column if it has been selected.
Configuration Dialog
Download
Requires DOpus 12.7.3
Script:
RegExpColumns.osp v1.13.0 (36.0 KB)
Older Versions
RegExpColumns.osp v1.12.0 (35.9 KB)
RegExpColumns.osp v1.9.0 (35.6 KB)
RegExpColumns.osp v1.8.0 (34.8 KB)
RegExpColumns.osp v1.6.0 (33.9 KB)
RegExpColumns.osp v1.5.6 (33.3 KB)
RegExpColumns.osp v1.5.5 (33.3 KB)
RegExpColumns.osp v1.5.2 (33.2 KB)
RegExpColumns.osp v1.5 (32.6 KB)
Config Button:
This button will display the configuration dialog.
Raw command: RegExpColumnsConfigure
XML button data you can copy & paste from the forum directly to a toolbar:
<?xml version="1.0"?>
<button backcol="none" display="both" textcol="none">
<label>RegExp </label>
<tip>Manage RegExp Columns</tip>
<icon1>#RegExpColumns:RegExpBlue</icon1>
<function type="normal">
<instruction>RegExpColumnsConfigure</instruction>
</function>
</button>
Notes
As I am using a global variable this script might also be helpful (though its not necessary) global-variable-management-dialog.
Sometimes apply changes button does not refresh the columns, Press F5 in dopus and it should update correctly.
I hope you find this useful and easy to use .