The GEN, HDG, HKF, HPV, SRW, VTO & VUT parts of the filename are abbreviations but I want to display the full text. i.e. "General" instead of GEN" etc.
Looking at a few sample scripts I reckon I can create the column and populate it but I don't know if the alternative text is possible. Does anyone else know any better?
I've had a look at the link above and all the links to Andy's site but I can't find anything on alternative text. Renaming the files using Andy's "[year=2004_dir=Martin Scorcese]" convention is not permitted in this case.
It pulls parts of the filename out into columns using regular expressions. Aside from defining the regexes to match the bits of the filename you're looking for, you'd need to add a bit of logic that takes what was found and expands GEN to General and whatever your other rules/expansions need to be.
I've read through all the links but still not much wiser. I have almost managed to put together the code the create and populate the columns (not with alternative text for now...but it's a start) but I am struggling with the RegExp. The expressions below works fine in the Opus rename panel but not within a script.
[code]// Opus calls OnInit to initialize the script add-in function OnInit(initData) {
//uid added via script wizard (do not change after publishing this script)
var uid = "98D528BF-0B42-4F51-85E0-6770DABF47BE";
//resource center url added via script wizard (required for updating)
var url = "Column with alternative text
// basic information about the script
initData.name = "BIM Columns";
initData.desc = "Adds columns defined by regex search against filenames.";
initData.copyright = "Blueroly 2016";
initData.min_version = "11.5.1"
initData.version = "0.9.2";
initData.default_enable = true;
// The following prefix is added to the column names when looking at columns in
// the Folder Format panel, in order to distinguish the column from
// similar columns from other scripts.
// The prefix will not show in the actual column header
var ColumnPrefix = "BIM.";
Your JSON at the bottom is not syntactically correct.
JSON strings should be quoted (especially if they contain { and }) and JScript strings should have \ turned into \ since the \ on its own is an escape character. You also need a comma after each JSON name/value pair, I think. (I am not sure as this is the first time I've ever used JSON and I'm just copying what I see from some examples myself.)