How to use FILTERDEF with {dlgstringS}?

Run this, all is OK
copy {filepath$} FILTERDEF size match >= 1 mb

When using {dlgstringS} to get a value, This code doesn't work as expected:

@set size="{dlgstringS||1}"
copy {filepath$} FILTERDEF size match >= {$size} mb

Is there a solution? if not use a script.

I think a script would be needed, as the filter definition can't use {...} codes.

That would also let you do some input validation to ensure only a number is being inserted.

BTW, you don't need to specify {filepath$} as the selection will be copied by default.

1 Like

I think it's more of an execution order problem. This seems to work:

Copy FILTERDEF size match >= {dlgstringS||1} mb

That didn't work with the {filepath$} still there, so I figured it didn't work in general, but you're right, it seems good so far.

1 Like

First,{dlgstringS} will popup a window for every selected file.

You need to remove {filepath$}.

1 Like

all OK now!
thank you all!

I use a script to get relative pathdepth.

function OnAddColumns(addColData) {
	var col = addColData.AddColumn();
    col.name = 'RelPathDepth';
    col.method = 'OnRelPathDepth';
    col.justify = 'right';
    col.type = 'number';
	col.label = "PathDepth(Relative)"
}

function OnRelPathDepth(scriptColData) {
	var relDepth = scriptColData.item.path.components - DOpus.Listers.lastactive.activetab.path.components;
    scriptColData.value = relDepth<0 ?  0: relDepth;
}

and use script column like this:

copy FILTERDEF type match group 图片 and script match PathDepth/RelPathDepth = {dlgstringS||1}