Page 1 of 2

Color filter for Directional Codes filename protection

Posted: 11 Oct 2016 11:38
by Millzey
I've had trouble with invalid filenames files coming from inside archives, and particular characters even causing system crashes with certain OS updates applied or needed. I also often run into the the directional formatting codes protection every once in awhile which makes me nervous, so I quickly rename the folder before doing any action on it. I'm paranoid about overlooking these folders and running actions on them, even just opening them, so I wanted to make a color filter for anything with the applied "*!*" mask so I would see it instantly when browsing. However everything I tried didnt work, and I also dont know how to replicate one of these names safely to keep trying a matching filter. Will this work with the current filters or is it a special condition considering the asterisk and exclaimation?

Thanks

Re: Color filter for Directional Codes filename protection

Posted: 11 Oct 2016 12:15
by highend
So you want to create a color filter that matches folder names with specific chars in it?

Code: Select all

dir: *z*;*y*
You replace "z" with one of these chars that exist in such a folder name
The same for "y" and additionally for all other entries that you add with ";"...

Re: Color filter for Directional Codes filename protection

Posted: 12 Oct 2016 13:25
by Marco
The only problem is that it's tricky - I mean, pasting an invisible character is tricky. If CF supported regexes, all you need would be a \u202e (for the RTL override, for example).

Re: Color filter for Directional Codes filename protection

Posted: 12 Oct 2016 13:49
by highend
But pasting unicode representations as regex "characters" is difficult for 99% of the userbase as well :)

Why not write a script that works for his case and renames such folders appropriately? UMC is ready for an open beta test in a few days anyway... xD A simple right click & hold on a folder and execute such a script will be simple as pie^^

Re: Color filter for Directional Codes filename protection

Posted: 12 Oct 2016 15:21
by Millzey
Low an behold I just ran into another masked dir. It appears to be the \u200E character on this one.

I tried dir:*U+200E* but that didnt work. I tried copy and paste of the folder name from XYP and explorer into the color filter, and removing all almost all of the text except for where I knew the character was at. That didnt work.

I also tried dir:*!* like you suggested, but that didnt recognize the protected mask in the folder name either. Seems maybe an escape for the asterisk might be a solution.

Color filters supporting regexs/UCN sounds like a solution, but if that wouldnt work couldnt just the "dir:" attribute check for the applied "*!*" mask and if that is present in the color filter color the folder?

The whole point is to avoid these dangerous files/folders by alerting the user as soon a possible by the color filters, and rename them quickly. A script is fine but it doesnt help avoid overlooking the existence of one so it doesnt perform some harmful action. Just a *!* in the name is easy to overlook. Am I paranoid and blowing the dangers out of proportion?

Re: Color filter for Directional Codes filename protection

Posted: 12 Oct 2016 15:44
by highend
It's not colored but you could use a custom column with a script that checks if the name contains one of the DFCs and fills the column with either "###WARNING###" or nothing. Should be visible enough^^

Re: Color filter for Directional Codes filename protection

Posted: 12 Oct 2016 15:59
by TheQwerty
  1. Open Windows' Character Map (Run dialog > charmap.exe)
  2. Check Advanced View
  3. Select Unicode under Character Set.
  4. Enter 200E in the Go to Unicode field.
    This will jump to the Left-To-Right mark character.
  5. Press Select
  6. Repeat for the other DFCs which the safety belt handles:
    • U+200E = "Left-to-Right Mark"
    • U+200F = "Right-to-Left Mark"
    • U+202A = "Left-to-Right Embedding"
    • U+202B = "Right-to-Left Embedding"
    • U+202C = "Pop Directional Formatting"
    • U+202D = "Left-to-Right Override"
    • U+202E = "Right-to-Left Override"
  7. Once you have selected all desired characters, press Copy.
  8. In XYplorer create a new Color Filter.
  9. For the pattern:
    1. Type:

      Code: Select all

      "Directional Format Characters" []
    2. Move the cursor left (so it is within the brackets).
    3. Paste from the system clipboard (the characters you just copied from Character Map).
      The idea is to end up with:

      Code: Select all

      "Directional Format Characters" [<clipboard>]
  10. Configure the colors for the filter.
    EDIT: Tip: Use the Tools > Configuration > Color Filters dialog for this - it can be a bit painful attempting to type your colors in the Tools > List Management > Color Filters dialog.
This will then apply the coloring to any items whose name contains any of the characters within the brackets.

Tip: The "Directional Format Characters" is just a caption to help when looking at your list of filters, and in this case will work much better than using a comment:

Code: Select all

[<clipboard>] //Directional Format Characters
For reasons that become clear after you paste those characters. ;)


HTH


EDIT: Don, this might be a good addition to the default color filters or ICFs. :whistle:

Re: Color filter for Directional Codes filename protection

Posted: 12 Oct 2016 16:06
by highend
TheQwerty wrote:Not fullquoting your instructions here^^
:appl: :appl: :appl:

Re: Color filter for Directional Codes filename protection

Posted: 12 Oct 2016 16:45
by Marco
TheQwerty wrote:...For reasons that become clear after you paste those characters. ;)
The same reasons that prevent us from writing here an easy to copypaste filter ;)

Re: Color filter for Directional Codes filename protection

Posted: 13 Oct 2016 13:08
by highend
I included a dfcs removal script in UMC :shock:

Before:

Code: Select all

R:\CORP_INVOICE_08.14.2011_Pr.phyl‮exe.doc
R:\H‮txt.exe
After:

Code: Select all

R:\CORP_INVOICE_08.14.2011_Pr.phylexe.doc
R:\Htxt.exe

Re: Color filter for Directional Codes filename protection

Posted: 15 Oct 2016 02:09
by Millzey
Thanks for all the help.

What is UMC and can you link me to it?

Re: Color filter for Directional Codes filename protection

Posted: 15 Oct 2016 08:10
by highend
UMC = Ultimate Menu Configurator

Open beta test will start (probably) on the next weekend so atm there is no official link yet

Re: Color filter for Directional Codes filename protection

Posted: 15 Oct 2016 19:04
by Marco
This should be copypast-able :whistle:

Code: Select all

"Directional Format Characters" [‮‭‬‫‪‏‎]

Re: Color filter for Directional Codes filename protection

Posted: 21 Oct 2016 16:03
by admin
What about a variable for single characters in this format:

Code: Select all

<U+200E>

Re: Color filter for Directional Codes filename protection

Posted: 22 Oct 2016 05:08
by Millzey
Works for me thanks for looking into adding the feature.

Since posting I ran into a few other unicodes not on the direction protection list that are invisible and actually present a problem (zero width space, etc), that when copying some or all of the filename string and pasting for searching somewhere else like a website or program yields no results. This feature would be nice to see when those are present also so they can be renamed.