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
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