Toggle File Colors ?
-
CookieMonster
Toggle File Colors ?
How can I toggle files between two different colors ? As well how do you colorize shared network folders for a networked computer ?
-
highend
- Posts: 15003
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Toggle File Colors ?
Which colors, labels / color (or instant color) filters?How can I toggle files between two different colors ?
E.g. for a color filter:As well how do you colorize shared network folders for a networked computer ?
Code: Select all
dir:\\<your netbios server name>\folder\*somefolderall subfolders beyond somefolder would be colored as well^^
One of my scripts helped you out? Please donate via Paypal
-
CookieMonster
Re: Toggle File Colors ?
Instant Color Filters. The goal is simple toggle selected files with two different colors, quickly.Which colors, labels / color (or instant color) filters?
Code: Select all
dir:\\<your netbios server name>\folder\*somefolderCode: Select all
dir:\\<NetworkDriveName>\<sharedFolder>* -
highend
- Posts: 15003
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Toggle File Colors ?
I wouldn't do that with instant colorfilters, at least not for selected items (they are not bound to a specific folder / item type)
A version that uses labels:
Why does that look so complicated? Because it's much faster to use tagitems on a bunch of files only once instead
for each and every single file...
A version that uses labels:
Code: Select all
$label1 = 1; // Red
$label2 = 4; // Green
$label1List = "";
$items = get("SelectedItemsPathNames", "|");
$tags = tagitems(, , , 1);
while ($i++ < gettoken($items, "count", "|")) {
if (gettoken($tags, $i, "|") == $label1) { $label1List = $label1List . gettoken($items, $i, "|") . "|"; }
}
if ($label1List) { tagitems(, $label2, $label1List); }
$label2List = formatlist($items, "F", , "!$label1List");
if ($label2List) { tagitems(, $label1, $label2List); }
for each and every single file...
One of my scripts helped you out? Please donate via Paypal
-
CookieMonster
Re: Toggle File Colors ?
The above code works on single files as well ?
I placed the code in a button that is to be executed by the right mouse; nothing happens ?
I placed the code in a button that is to be executed by the right mouse; nothing happens ?
-
highend
- Posts: 15003
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Toggle File Colors ?
OfcThe above code works on single files as well ?
One of my scripts helped you out? Please donate via Paypal
-
CookieMonster
Re: Toggle File Colors ?
I created a button in the toolbar which should work when right clicking on a file, as the script was placed within the OnRightClick for the button; instead windows default context menu appears ?
-
highend
- Posts: 15003
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Toggle File Colors ?
A button's script should be fired when you click on a file in the list pane?
You have to right-click the button to fire the script^^
You have to right-click the button to fire the script^^
One of my scripts helped you out? Please donate via Paypal
-
CookieMonster
Re: Toggle File Colors ?
I was able to label the file color to red; although I wasn't able to toggle between red, green and off when right clicking on the button to launch the script per file ?A button's script should be fired when you click on a file in the list pane?
You have to right-click the button to fire the script^^
-
highend
- Posts: 15003
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Toggle File Colors ?
That was never a requirement^^and off
How can I toggle files between two different colors ?
Code: Select all
$label1 = 1; // Red
$label2 = 4; // Green
$labels = ""; $labels1 = ""; $labels2 = "";
$items = get("SelectedItemsPathNames", "|");
$tags = tagitems(, , , 1);
while ($i++ < gettoken($items, "count", "|")) {
switch (gettoken($tags, $i, "|")) {
case $label1:
$labels1 = $labels1 . gettoken($items, $i, "|") . "|"; break;
case $label2:
$labels2 = $labels2 . gettoken($items, $i, "|") . "|"; break;
case default:
$labels = $labels . gettoken($items, $i, "|") . "|";
}
}
if ($labels) { tagitems(, $label1, $labels); }
if ($labels1) { tagitems(, $label2, $labels1); }
if ($labels2) { tagitems(, "", $labels2); }
One of my scripts helped you out? Please donate via Paypal
XYplorer Beta Club