To answer a simple question
Of course its possible to make such a script.
I think this is a good example to learn XY scripting from the help
and by reading the examples here in the forum.
I did the same month ago.
If you then have real problems and questions ask here again
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527) Portable XYplorer (actual version, including betas)
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73