Two related questions about columns

The manual says that the column object has four properties and no methods. Suppose that the columns have been enumerated by clickData.func.sourcetab.format.columns, and that oColumn is one of those columns, with position nColumn.

QUESTION 1: How do I get the display name of oColumn, that is, the heading shown at the top of the column in the display? This display name is often different from oColumn.name.

QUESTION 2: To set the size of oColumn to fit its texts, there is a DOpus command:
Set ColumnAdd (nColumn,*)
But how do I set the column width of oColumn to be the width specified by the folder format for the particular directory (assuming that oColumn is in that directory's folder format)?

  • Is there a DOpus command that works just for the one column, or
  • Is there a way within the script to get the folder format width so that it can be inserted to replace the asterisk above?

I'd say you cannot get to column widths of any folder format from the scripting side, unless you start parsing DOs configuration files, which I would not suggest. Currently there is no support in the scripting API to get/edit folder formats or the current columns deriving from there.

Thanks for that, tbone. I'd noticed the lack of anything about folder formats in the script sections, and I was expecting a negative answer.

I am more hopeful of a positive answer to my first question, because the display name should surely be available to scripts. The differences between the column name and the column display name can cause confusion, particularly for some script columns --- if there is no way to get at the display name at the moment, could I suggest that the following fifth property be added to the column properties:
oColumn.display_name

What is it that you're doing or trying to do with the column details?

What I'm trying to do is display in a dialogue box the column header that the user actually sees on his screen.

Actually, I want both the display header name, and oColumn.name, displayed to him (actually to her, my wife), because sometimes both are needed for clarity.

The Column object can tell you the width. No way to get the display name at the moment unfortunately.

Thanks, Jon. I think I can work around it.

A future update will include "Header" and "Label" properties for the columns, corresponding to the similar fields when adding a script column.

Thanks, leo. That's good news.