# The "col.method" in this script is always called, even if the script column is not added. Why?

**URL:** <https://resource.dopus.com/t/the-col-method-in-this-script-is-always-called-even-if-the-script-column-is-not-added-why/53571>\
**Category:** Help & Support\
**Created:** [November 21, 2024, 10:11am UTC](https://resource.dopus.com/t/the-col-method-in-this-script-is-always-called-even-if-the-script-column-is-not-added-why/53571 "2024-11-21T10:11:42Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![bytim](https://resource.dopus.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bytim](https://resource.dopus.com/u/bytim)\
**Post date:** [November 21, 2024, 10:11am UTC](https://resource.dopus.com/t/the-col-method-in-this-script-is-always-called-even-if-the-script-column-is-not-added-why/53571/1 "2024-11-21T10:11:42Z")

</div>

[Column.File\_FileInfo.js.txt](https://resource.dopus.com/uploads/short-url/3IeM619t5nBCW8rVtYwAx3WGfjg.txt) (874 Bytes)

You can try it.  
Install the script above, restart DOpus, Then open script log.  
Press F5 to fresh flle list.  
You will see these output without adding the script column :

 ![image](https://resource.dopus.com/uploads/default/original/3X/e/3/e3b1245c83486f28d905df0088b990577724be7e.png)

this is the script code:

```auto
function OnInit(data){
	data.name = "Column.File: FileInfo";
	data.desc = "Columns providing details for plain text files.";
	if (DOpus.Version.AtLeast("12.0.8")) data.url = "http://resource.dopus.com/viewtopic.php?f=35&t=22835";
	data.copyright = "tbone";
	data.version = "1.3.3";
	data.default_enable = true;
	colPrefix = "FI: "

	var col = data.AddColumn();
	col.name = "Encoding";
	col.header = "Encoding";
	col.label = colPrefix + col.header;
	col.method = "Column_Encoding";
	col.justify = "right";
	col.type = "text";
	col.autogroup = true;
}

function Column_Encoding(data){
	DOpus.Output("Why call me??? - Filepath:" + data.item.name, false ,true)
	data.value = "111";
}

```

I found that: in DO v12, the script method function is not called if the column is not added.  
but in Do v13, the function is always called..

---

<div class="post-metadata">

**Author:** ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)\
**Post date:** [November 21, 2024, 10:33am UTC](https://resource.dopus.com/t/the-col-method-in-this-script-is-always-called-even-if-the-script-column-is-not-added-why/53571/2 "2024-11-21T10:33:08Z")

</div>

I can't reproduce that here, fwiw.

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [November 21, 2024, 10:37am UTC](https://resource.dopus.com/t/the-col-method-in-this-script-is-always-called-even-if-the-script-column-is-not-added-why/53571/3 "2024-11-21T10:37:25Z")

</div>

Neither can I.

---

<div class="post-metadata">

**Author:** ![bytim](https://resource.dopus.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bytim](https://resource.dopus.com/u/bytim)\
**Post date:** [November 21, 2024, 10:45am UTC](https://resource.dopus.com/t/the-col-method-in-this-script-is-always-called-even-if-the-script-column-is-not-added-why/53571/4 "2024-11-21T10:45:40Z")

</div>

How to remove the invalid script columns?

---

<div class="post-metadata">

**Author:** ![PassThePeas](https://resource.dopus.com/user_avatar/resource.dopus.com/passthepeas/32/50972_2.png) [@PassThePeas](https://resource.dopus.com/u/PassThePeas)\
**Post date:** [November 21, 2024, 10:46am UTC](https://resource.dopus.com/t/the-col-method-in-this-script-is-always-called-even-if-the-script-column-is-not-added-why/53571/5 "2024-11-21T10:46:48Z")

</div>

Are you sure you don't have a tab where the column is displayed somewhere ? (I can't see for this very tab since the screenshot is cropped).

---

<div class="post-metadata">

**Author:** ![bytim](https://resource.dopus.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bytim](https://resource.dopus.com/u/bytim)\
**Post date:** [November 21, 2024, 10:53am UTC](https://resource.dopus.com/t/the-col-method-in-this-script-is-always-called-even-if-the-script-column-is-not-added-why/53571/6 "2024-11-21T10:53:18Z")

</div>

![image](https://resource.dopus.com/uploads/default/original/3X/8/7/8710ad1862c6a2217a593c2289a694e975791740.png)

I sure I don't add the column.

---

<div class="post-metadata">

**Author:** ![bytim](https://resource.dopus.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bytim](https://resource.dopus.com/u/bytim)\
**Post date:** [November 21, 2024, 11:13am UTC](https://resource.dopus.com/t/the-col-method-in-this-script-is-always-called-even-if-the-script-column-is-not-added-why/53571/7 "2024-11-21T11:13:46Z")

</div>

It's strange that the items in File Collection in the tree are included in the evaluation scope by the script.

 ![image](https://resource.dopus.com/uploads/default/original/3X/f/d/fddc584a8317eeefd6a9b5cc1306f8efaea4b803.png)

 ![image](https://resource.dopus.com/uploads/default/original/3X/4/b/4b79b16f4134d26d1019d6f1c4fa2ce7219acba4.png)

---

<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:** [November 21, 2024, 11:31am UTC](https://resource.dopus.com/t/the-col-method-in-this-script-is-always-called-even-if-the-script-column-is-not-added-why/53571/8 "2024-11-21T11:31:23Z")

</div>

Have you set up a filter label that uses the column?

---

<div class="post-metadata">

**Author:** ![bytim](https://resource.dopus.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bytim](https://resource.dopus.com/u/bytim)\
**Post date:** [November 21, 2024, 3:34pm UTC](https://resource.dopus.com/t/the-col-method-in-this-script-is-always-called-even-if-the-script-column-is-not-added-why/53571/9 "2024-11-21T15:34:18Z")

</div>

I found it.  
In the path [/appdata\GPSoftware\Directory Opus\ConfigFiles] , Replace the two files foldercolors.oxc and colorgroups.oxc with this:  
[colorgroups foldercolors.zip](https://resource.dopus.com/uploads/short-url/9NZFWk8SoEGWoL8pRltEmiMSIC0.zip) (3.4 KB)

instal this script：  
[Column.File\_FileInfo.js.txt](https://resource.dopus.com/uploads/short-url/onV892L6Bpapo1bD5ZgPRtBjmH8.txt) (745 Bytes)

restart DOpus. Press F5, then you will see my ploblem...

---

<div class="post-metadata">

**Author:** ![bytim](https://resource.dopus.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bytim](https://resource.dopus.com/u/bytim)\
**Post date:** [November 21, 2024, 3:51pm UTC](https://resource.dopus.com/t/the-col-method-in-this-script-is-always-called-even-if-the-script-column-is-not-added-why/53571/10 "2024-11-21T15:51:31Z")

</div>

I get it. The custom status icon cause this problem.  
it is so strange...  
what happens to the script？

 ![image](https://resource.dopus.com/uploads/default/original/3X/8/c/8c60ef24a1287c9fbc70eff4b49dc0bc2f6fb13b.png)

---

<div class="post-metadata">

**Author:** ![bytim](https://resource.dopus.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bytim](https://resource.dopus.com/u/bytim)\
**Post date:** [November 21, 2024, 5:07pm UTC](https://resource.dopus.com/t/the-col-method-in-this-script-is-always-called-even-if-the-script-column-is-not-added-why/53571/11 "2024-11-21T17:07:17Z")

</div>

I use a script----CuMediaExtenders.osp,and  
I set label assignments like this：

 ![image](https://resource.dopus.com/uploads/default/original/3X/f/0/f06917c69511d8c3184b547bb964c72714168af2.png)

The label "MExt-Clean" matches the value of "CuMediaExtenders/MExt\_NeedsUpdate" column.  
After I deleted the script "CuMediaExtenders.osp", it changed to match the lastest column in [/appdata\GPSoftware\Directory Opus\ConfigFiles\scriptcolumns.oxc]

 ![image](https://resource.dopus.com/uploads/default/original/3X/3/2/3247872321be84c318ed8110670b7b0c08c373a6.png)

 ![image](https://resource.dopus.com/uploads/default/original/3X/7/0/70f12a6fde906bf08db659d2a13a6efd5a65c268.png)
