Hi there I was wondering if there is a way to apply an instant color filter or a regular one to color folders that their name exists in a text file.
I appreciate your help as I am new.
Thanks!
Color filter based on folder names in a txt file
Re: Color filter based on folder names in a txt file
Code: Select all
$file = "D:\Users\Highend\Downloads\Folders.txt";
$content = readfile($file, , , 65001);
$items = "";
foreach($item, $content, <crlf>, "e") {
if ($item == "") { continue; }
$items .= " OR dir:" . quote($item);
}
if ($items) {
$items = regexreplace($items, "^ OR ");
colorfilter($items . ">BF6000,");
}
Otherwise you would need to use labels^^
One of my scripts helped you out? Please donate via Paypal
Re: Color filter based on folder names in a txt file
I appreciate it. It is what i needed.
I was about to ask you how to remove the color filter but it was easy to figure out that you need to press the button again.
In terms of the other way you suggested (labels) I was under the impression that labels can only be applied manually. Is there a way to apply them using a similar script that reads again from a txt file?
Thanks!
I was about to ask you how to remove the color filter but it was easy to figure out that you need to press the button again.
In terms of the other way you suggested (labels) I was under the impression that labels can only be applied manually. Is there a way to apply them using a similar script that reads again from a txt file?
Thanks!
Re: Color filter based on folder names in a txt file
Code: Select all
$file = "D:\Users\Highend\Downloads\Folders.txt";
$content = readfile($file, , , 65001);
$items = "";
foreach($item, $content, <crlf>, "e") {
if ($item == "") { continue; }
$items .= $item . <crlf>;
}
if ($items) {
tagitems("label", "Orange", $items);
}
One of my scripts helped you out? Please donate via Paypal
Re: Color filter based on folder names in a txt file
I am trying to find out first why the labels script doesn't work. I am using the exact same txt file with the previous script (color filter).
Re: Color filter based on folder names in a txt file
tagitems()
expects full paths, not parts of it.One of my scripts helped you out? Please donate via Paypal
Re: Color filter based on folder names in a txt file
Ok I see, now what you wrote at the bottom of your fist post makes sense (about full paths and labels).
To reset them, it can be done with a second button using this command:
tagitems("label", "", $items);
but I prefer the single toggle button as the color filter one that does both.
I appreciate your help.
To reset them, it can be done with a second button using this command:
tagitems("label", "", $items);
but I prefer the single toggle button as the color filter one that does both.
I appreciate your help.