Re: Find all tags
Posted: 17 Jul 2015 15:19
All files that appear in the window are either tagged, labelled or have a comment.
Code: Select all
$lb = "<crlf>";
$items = "";
foreach($item, "<get SelectedItemsPathNames <crlf>>", $lb) {
if (exists($item) == 1) { $items = $items . $item . report("?{Tags}?{Label}?{Comment}", $item) . $lb; }
else { $items = $items . folderreport("files:{fullname}?{Tags}?{Label}?{Comment}", "r", $item, "r", , $lb) . $lb; }
}
$tagged = regexmatches($items, ".*?\?\w+\?\?$", $lb);
$labelled = regexmatches($items, ".*?\?\?\w+\?$", $lb);
$commented = regexmatches($items, ".*?\?\?\?\w+$", $lb);
$items = regexmatches(formatlist($tagged . $lb . $labelled . $lb . $commented, "dents", $lb), "^.*?(?=\?)", $lb);
if ($items) {
if (confirm("Tags/Labels/Comments present. View?")) { text $items; }
} else { status "Selected items neither have a tag, label or comment", , "stop"; }