Try this:
// Tree search script - Searches for text in a file that is using a tab indented data structure.
//
// Copyright (C) Mythicsoft Ltd 2014
var parentLevels = new Array("", "", "", "", "", "", "", "");
var strSearchFor = SearchParms.ContainingTextCustomParm;
var regexCompare = new RegExp(strSearchFor, "i");
function isValidLine( nLineNum, strText )
{
var bIsValid = false;
try
{
// First calculate the tab indentation
var nTabLevel = 0;
while ((nTabLevel < strText.length) && (strText.charAt(nTabLevel) == "\t"))
++nTabLevel;
var strThis = strText.substr(nTabLevel);
parentLevels[nTabLevel] = strThis;
// Build up the parent string
var strParent = "";
for (var nParent = 0; (nParent <= nTabLevel) && (nParent < parentLevels.length) ; ++nParent)
{
if (strParent.length > 0)
strParent += "->";
strParent += parentLevels[nParent];
}
bIsValid = regexCompare.test(strParent);
}
catch( e ) {}
return bIsValid;
}
Each line will built to include the parent level data using '->' as a separator, e.g, Clothes->Colour->Black
. To search simply put the path your looking for in the Parm field.

IMPORTANT: Because lines are only passed to script if they've passed the filter you also need to specify a value in Containing Text on the Main tab. Something like * will do.
