I'm trying to find a file in the destination tab of a dual-lister that is based on a file name in the source tab (but that is not identical.)
To do this, I'm reading the file out of the source tab, manipulating it in VBScript using RegEx replace, then trying to do a selection in the destination frame of a dual lister.
Except., I can't figure out how to apply the selection to the destination half of the dual-lister. SELECT always wants to use the source frame.
I've tried various ways of getting SELECT to apply to the other tab, but none of them work.
So far, I've tried every combination of swap and select:
A swap:
cmd.RunCommand("Go TABSWAP")
cmd.RunCommand("Set QUICKFILTER """+ findthis + """")
cmd.RunCommand("Set SOURCE=toggle")
and a select:
cmd.RunCommand("Select """+ findthis + """ MAKEVISIBLE")
cmd.RunCommand("Set QUICKFILTER """+ findthis + """")
Here's my code that executes on right-click-context menu "select matching file in other pane":
Function OnClick(ByRef ClickData)
dim func
set func=ClickData.func
dim cmd
set cmd=func.command
sourcename=func.sourcetab.selected_files(0).name
set oRegExp = New RegExp
oRegExp.Pattern = "(\S*).*"
findthis = oRegExp.Replace(sourcename, "$1*")
cmd.RunCommand("Set SOURCE=toggle")
cmd.RunCommand("Select """+ findthis + """ MAKEVISIBLE")
cmd.RunCommand("Set SOURCE=toggle")
End Function
Thanks.