# Tutorial video: Column resizing & folder formats

**URL:** https://resource.dopus.com/t/tutorial-video-column-resizing-folder-formats/23208
**Category:** Tutorials
**Created:** [August 26, 2016, 7:14am UTC](https://resource.dopus.com/t/tutorial-video-column-resizing-folder-formats/23208 "2016-08-26T07:14:19Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [August 26, 2016, 11:46pm UTC](https://resource.dopus.com/t/tutorial-video-column-resizing-folder-formats/23208/6 "2016-08-26T23:46:43Z")

</div>

> [@tbone](#):
>
> Is the auto/fill-column toggle button to be found in the forum somewhere?

Here it is (updated with tbone's improvements; see below):  
[Auto-Size All.dcf](https://resource.dopus.com/uploads/default/original/3X/1/4/14b0e387a7edcceb422af83b78496b49cd6c9031.dcf) (1.44 KB)

Update:

- tbone has improved the script to work with column names that contain spaces, [here](https://resource.dopus.com/viewtopic.php?p=148368#p148368). I overlooked that, since none of the internal column names use spaces, but it is needed for script columns (including some of my own 😊).
- It has also been changed to not deselect everything when you use it.
- _Copying tbone's changes here to keep everything in one place:_

JScript: (v0.3 - tbone's improvements)

```javascript
function OnClick(clickData){
   var colParams = "";
   for(var e = new Enumerator(clickData.func.sourcetab.format.columns); !e.atEnd(); e.moveNext()){
      var col = e.item();
      if (!col.Autosize || col.Max != 0){
         if (colParams) colParams += ",";
         colParams += col.Name;
         colParams += "(!,a,0)"; // Keep position. Auto-size. No maximum.
      }
   }
   var cmd = "Set FORMAT=!folder";
   if (colParams) cmd = 'Set COLUMNSADD="'+colParams+'"';
   clickData.func.command.deselect = false;
   clickData.func.command.RunCommand(cmd);
}

```

**Installing** :  
As shown in the video, this script can be added to the [Column Header Context Menu](https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Menus.htm), by updating the **Lister Column Header** in the **Customize** dialog.  
 ![image](https://resource.dopus.com/uploads/default/original/3X/1/5/15fcbb1fd1d475deb6ea3944aaae63863620e1b1.png)

> **Original version shown in the video**
>
> JScript (original version shown in the video):
> 
> ```javascript
> function OnClick(clickData)
> {
> var anyColumns = false;
> var cmdLine = "Set COLUMNSADD=";
> for(var e = new Enumerator(clickData.func.sourcetab.format.columns); !e.atEnd(); e.moveNext())
> {
> var col = e.item();
> if (!col.Autosize || col.Max != 0)
> {
> if (anyColumns) cmdLine += ",";
> cmdLine += col.Name;
> cmdLine += "(!,a,0)"; // Keep position. Auto-size. No maximum.
> anyColumns = true;
> }
> }
> if (!anyColumns) cmdLine = "Set FORMAT=!folder";
> clickData.func.command.RunCommand(cmdLine);
> }
> 
> ```

---

_[View the full topic](https://resource.dopus.com/t/tutorial-video-column-resizing-folder-formats/23208)._
