I wrote a script for a custom column that draws circle based on the existence of specific file types inside a folder:
Code: Select all
"Draw Circle based on attachments"
$content = folderreport("files:{name}", "r", "<cc_item>");
$drawCmd = "";
if (regexmatches($content, ".ppt")) { $drawCmd = $drawCmd . "20, C43E1C, 200, 0, 0; ";}
if (regexmatches($content, ".doc")) { $drawCmd = $drawCmd . "20, 2B579A, 200, 0, 25; ";}
if (regexmatches($content, ".xls")) { $drawCmd = $drawCmd . "20, 185C37, 200, 0, 50; ";}
if (regexmatches($content, ".pdf")) { $drawCmd = $drawCmd . "20, B30B00, 200, 0, 75; ";}
if ($drawCmd == "") {
return ">draw.circle 20, 000000, 1, 0";
} else {
return ">draw.circle $drawCmd";
}
So I am asking you pro-scriptors whether there is a better way to achieve the same result.
Cheers!