Color filter for Directional Codes filename protection

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Millzey
Posts: 169
Joined: 07 Oct 2011 15:10

Color filter for Directional Codes filename protection

Post 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

highend
Posts: 14925
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Color filter for Directional Codes filename protection

Post 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 ";"...
One of my scripts helped you out? Please donate via Paypal

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Color filter for Directional Codes filename protection

Post 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).
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

highend
Posts: 14925
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Color filter for Directional Codes filename protection

Post 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^^
One of my scripts helped you out? Please donate via Paypal

Millzey
Posts: 169
Joined: 07 Oct 2011 15:10

Re: Color filter for Directional Codes filename protection

Post 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?

highend
Posts: 14925
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Color filter for Directional Codes filename protection

Post 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^^
One of my scripts helped you out? Please donate via Paypal

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Color filter for Directional Codes filename protection

Post 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:

highend
Posts: 14925
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Color filter for Directional Codes filename protection

Post by highend »

TheQwerty wrote:Not fullquoting your instructions here^^
:appl: :appl: :appl:
One of my scripts helped you out? Please donate via Paypal

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Color filter for Directional Codes filename protection

Post 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 ;)
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

highend
Posts: 14925
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Color filter for Directional Codes filename protection

Post 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
You do not have the required permissions to view the files attached to this post.
One of my scripts helped you out? Please donate via Paypal

Millzey
Posts: 169
Joined: 07 Oct 2011 15:10

Re: Color filter for Directional Codes filename protection

Post by Millzey »

Thanks for all the help.

What is UMC and can you link me to it?

highend
Posts: 14925
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Color filter for Directional Codes filename protection

Post by highend »

UMC = Ultimate Menu Configurator

Open beta test will start (probably) on the next weekend so atm there is no official link yet
One of my scripts helped you out? Please donate via Paypal

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Color filter for Directional Codes filename protection

Post by Marco »

This should be copypast-able :whistle:

Code: Select all

"Directional Format Characters" [‮‭‬‫‪‏‎]
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

admin
Site Admin
Posts: 66093
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Color filter for Directional Codes filename protection

Post by admin »

What about a variable for single characters in this format:

Code: Select all

<U+200E>

Millzey
Posts: 169
Joined: 07 Oct 2011 15:10

Re: Color filter for Directional Codes filename protection

Post 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.

Post Reply