To a 0-byte file is assigned a color tag

I think a 0-byte file is marked as orange, but it matches%USERPROFILE% the folder, I tried to add a script, but the following problems.

Partial script

    Set col = initData.AddColumn
    col.name = "IsEmpty"
    col.method = "OnIsEmpty"
    col.label = "Is Empty"
    col.justify = "left"
    col.nosort = True
    col.autogroup = False
    col.match.push_back(True)
    col.match.push_back(False)

Function IIf(Expression, TruePart, FalsePart)
    If Expression Then
        IIf = TruePart
    Else
        IIf = FalsePart
    End If
End Function

Function OnIsEmpty(ColData)
    Dopus.output ColData.Item.realpath & "  " & ColData.Item

    ColData.Value = IIf(Not ColData.Item.Is_dir And ColData.Item.Size = 0, True, False)   

End Function

ColData.item.is_dir error

2017/2/24 12:15 File Information: C:\Users\qiuqiu\搜索 C:\Users\qiuqiu\搜索
2017/2/24 12:15 File Information: 发生错误于 344,位置 5
2017/2/24 12:15 File Information: 对象不支持此属性或方法: 'ColData.item.is_dir' (0x800a01b6)
2017/2/24 12:15 File Information: C:\Users\qiuqiu\桌面 C:\Users\qiuqiu\桌面
2017/2/24 12:15 File Information: 发生错误于 344,位置 5
2017/2/24 12:15 File Information: 对象不支持此属性或方法: 'ColData.item.is_dir' (0x800a01b6)
2017/2/24 12:15 File Information: C:\Users\qiuqiu\OneDrive C:\Users\qiuqiu\OneDrive
2017/2/24 12:15 File Information: C:\Users\qiuqiu\联系人 C:\Users\qiuqiu\联系人
2017/2/24 12:15 File Information: 发生错误于 344,位置 5
2017/2/24 12:15 File Information: 对象不支持此属性或方法: 'ColData.item.is_dir' (0x800a01b6)
2017/2/24 12:15 File Information: C:\Users\qiuqiu\图片 C:\Users\qiuqiu\图片
2017/2/24 12:15 File Information: 发生错误于 344,位置 5
2017/2/24 12:15 File Information: 对象不支持此属性或方法: 'ColData.item.is_dir' (0x800a01b6)
2017/2/24 12:15 File Information: C:\Users\qiuqiu\收藏夹 C:\Users\qiuqiu\收藏夹
2017/2/24 12:15 File Information: 发生错误于 344,位置 5
2017/2/24 12:15 File Information: 对象不支持此属性或方法: 'ColData.item.is_dir' (0x800a01b6)
2017/2/24 12:15 File Information: C:\Users\qiuqiu\视频 C:\Users\qiuqiu\视频
2017/2/24 12:15 File Information: 发生错误于 344,位置 5
2017/2/24 12:15 File Information: 对象不支持此属性或方法: 'ColData.item.is_dir' (0x800a01b6)
2017/2/24 12:15 File Information: C:\Users\qiuqiu\音乐 C:\Users\qiuqiu\音乐
2017/2/24 12:15 File Information: 发生错误于 344,位置 5
2017/2/24 12:15 File Information: 对象不支持此属性或方法: 'ColData.item.is_dir' (0x800a01b6)
2017/2/24 12:15 File Information: C:\Users\qiuqiu\下载 C:\Users\qiuqiu\下载
2017/2/24 12:15 File Information: 发生错误于 344,位置 5
2017/2/24 12:15 File Information: 对象不支持此属性或方法: 'ColData.item.is_dir' (0x800a01b6)
2017/2/24 12:15 File Information: C:\Users\qiuqiu\文档 C:\Users\qiuqiu\文档
2017/2/24 12:15 File Information: 发生错误于 344,位置 5
2017/2/24 12:15 File Information: 对象不支持此属性或方法: 'ColData.item.is_dir' (0x800a01b6)
2017/2/24 12:15 File Information: C:\Users\qiuqiu\链接 C:\Users\qiuqiu\链接
2017/2/24 12:15 File Information: 发生错误于 344,位置 5
2017/2/24 12:15 File Information: 对象不支持此属性或方法: 'ColData.item.is_dir' (0x800a01b6)
2017/2/24 12:15 File Information: C:\Users\qiuqiu\保存的游戏 C:\Users\qiuqiu\保存的游戏
2017/2/24 12:15 File Information: 发生错误于 344,位置 5
2017/2/24 12:15 File Information: 对象不支持此属性或方法: 'ColData.item.is_dir' (0x800a01b6)

  • Which version of Opus are you seeing this in?

  • Please post the full script so we can try it on our computers.

version:12.3.6

goto %USERPROFILE%, press F5

Function OnInit(initData)
	initData.name = "File Is Empty"
	initData.version = "1.0"
	initData.copyright = "(c) 2017 qiuqiu"
'	initData.url = "https://resource.dopus.com/viewforum.php?f=35"
	initData.desc = "File Is Empty"
	initData.default_enable = true
	initData.min_version = "12.0"

	Dim col

    Set col = initData.AddColumn
    col.name = "IsEmpty"
    col.method = "OnIsEmpty"
    col.label = "Is Empty"
    col.justify = "left"
    col.nosort = True
    col.autogroup = False
    col.match.push_back(True)
    col.match.push_back(False)
End Function

Function IIf(Expression, TruePart, FalsePart)
    If Expression Then
        IIf = TruePart
    Else
        IIf = FalsePart
    End If
End Function

' Implement the IsEmpty column
Function OnIsEmpty(ColData)
    Dopus.output "realpath: " & ColData.Item.realpath & "  Item:" & ColData.Item
    ColData.Value = IIf(Not ColData.Item.Is_dir And ColData.Item.Size = 0, True, False)   
End Function

This color also matches in the folder tree

%USERPROFILE%
%USERPROFILE%\OneDrive
%USERPROFILE%\Saved Games
%USERPROFILE%\Contacts
%USERPROFILE%\Links
%USERPROFILE%\Videos
%USERPROFILE%\Favorites
%USERPROFILE%\Searches
%USERPROFILE%\Pictures
%USERPROFILE%\Documents
%USERPROFILE%\Downloads
%USERPROFILE%\Music
%USERPROFILE%\Desktop

If you do not add path length greater than 3 will match each disk's root directory

Is this bug? If that is the case the next version can solve?
I just want to use special colors mark a 0-byte file.
@Leo @Jon

We haven't had a chance to look in depth yet.

Script file contains two or more script column, there will be a problem that can't be matched color label.

Windows 10 Professional Edition, Directory Opus 12.3.7

option explicit

' IsEmptyFile
' (c) 2017 qiuqiu

' This is a script for Directory Opus.
' See http://www.gpsoft.com.au/DScripts/redirect.asp?page=scripts for development information.

' Called by Directory Opus to initialize the script
Function OnInit(initData)
	initData.name = "IsEmptyFile"
	initData.version = "1.0"
	initData.copyright = "(c) 2017 qiuqiu"
'	initData.url = "https://resource.dopus.com/viewforum.php?f=35"
	initData.desc = ""
	initData.default_enable = true
	initData.min_version = "12.0"

	Dim col
	Set col = initData.AddColumn
    col.name = "IsEmptyFile"
    col.label = "Is Empty"
    col.justify = "left"
    col.nosort = True
    col.autogroup = False
	'col.infotiponly = True
    col.method = "OnIsEmpty"
    col.match.push_back(CStr(True))

End Function

' Implement the IsEmptyFile column
Function OnIsEmpty(IsEmptyColData)
    if DOpus.FSUtil.gettype(IsEmptyColData.item, "a") = "file" then 
        if IsEmptyColData.item.size = 0 then IsEmptyColData.value = CStr(true)
    End If
End Function

Problems occur with this script will

option explicit

' IsEmptyFile
' (c) 2017 qiuqiu

' This is a script for Directory Opus.
' See http://www.gpsoft.com.au/DScripts/redirect.asp?page=scripts for development information.

' Called by Directory Opus to initialize the script
Function OnInit(initData)
	initData.name = "IsEmptyFile"
	initData.version = "1.0"
	initData.copyright = "(c) 2017 qiuqiu"
'	initData.url = "https://resource.dopus.com/viewforum.php?f=35"
	initData.desc = ""
	initData.default_enable = true
	initData.min_version = "12.0"

	Dim col
	Set col = initData.AddColumn
    col.name = "IsEmptyFile"
    col.label = "Is Empty"
    col.justify = "left"
    col.nosort = True
    col.autogroup = False
	'col.infotiponly = True
    col.method = "OnIsEmpty"
    col.match.push_back(CStr(True))

    Set col = initData.AddColumn
    col.name = "Test"
    col.method = "OnTest"
    col.label = "Test"
    col.justify = "left"
    col.autogroup = True

End Function

' Implement the IsEmptyFile column
Function OnIsEmpty(IsEmptyColData)
    if DOpus.FSUtil.gettype(IsEmptyColData.item, "a") = "file" then 
        if IsEmptyColData.item.size = 0 then IsEmptyColData.value = CStr(true)
    End If
End Function

Function OnTest(TestColData)
    TestColData.value = "Test.."
End Function