[AHK] redirecting Windows Explorer to XY

Discuss and share scripts and script files...
Keagel
Posts: 9
Joined: 29 Apr 2020 15:20

Re: [AHK] redirecting win explorer windows to XY

Post by Keagel »

This is exactly what I was looking for, thank you!
May I suggest adding the possibility to set the Windows Explorer window off-screen and letting Windows save its position so that it doesn't appear at all when opened?

autocart
Posts: 839
Joined: 26 Sep 2013 15:22

Re: [AHK] redirecting win explorer windows to XY

Post by autocart »

1024mb wrote: 29 Apr 2020 07:54 Thanks for the update and the quick response, I didn't expected that, sorry for taking so long to write back.
...
Have you tried installing the software and opening the paths? IDM has a trial if you want to download it, I can will of course keep providing feedback.
...
With 3.4 everything works GREAT, paths are opened in a new tab now with every single file, thanks!!!
...
By the way, I have collected some strings (at least the ones that Windows 10 uses) that belong to Control Panel but they are in Spanish so you can add them to the script:

Code: Select all

|Panel de control|Sistema y seguridad|Seguridad y mantenimiento|Firewall de Windows Defender|Sistema|Opciones de energía|Cifrado de unidad BitLocker|Carpetas de trabajo|Redes e Internet|Centro de redes y recursos compartidos|Hardware y sonido|Dispositivos e impresoras|Reproducción automática|Programas|Programas y características|Programas predeterminados|Cuentas de usuario|Administrador de credenciales|Apariencia y personalización|Reloj y región|Accesibilidad|Centro de accesibilidad|Reconocimiento de voz|
You are super welcome. :tup: I was up until 4 a.m. just for you. :biggrin: Joke. Not really. Would have been up that long anyway. Besides, no problem regarding the time you took. I was then sleeping for the rest of the night/morning. :kidding: You must be located somewhere in the Americanas, because of the time and because of Spanish. I am located in Europe.

Regarding the IDM software, although the script works for you now, for future reference I want to emphazise again that the software which opens Windows Explorer has no effect on the script's working what so ever. It does not matter which software it is. Therefore I would never have need to try installing a software just to open WE, because it would not make any difference.

I am glad, that it works now. Thx for the feedback. :D

Thanks also for the Spanish words. I will add them as further suggestions to the code. :tup:

BTW, did you notice the optional RegEx-compare method? It is much more powerful than stating all those keywords. E.g. I have my RegEx activated and am checking for regular paths (like "C:\path\folder" and only a few keywords, like "This PC") which I then let the script redirect. All other stuff is *not* redirected. This way I don't have to care about all these keywords as exceptions, and it is impossible for me to "miss" or forget any keywords. Just saying. :whistle: :)

autocart
Posts: 839
Joined: 26 Sep 2013 15:22

Re: [AHK] redirecting win explorer windows to XY

Post by autocart »

Keagel wrote: 29 Apr 2020 15:29 This is exactly what I was looking for, thank you!
May I suggest adding the possibility to set the Windows Explorer window off-screen and letting Windows save its position so that it doesn't appear at all when opened?
Hi Keagel,

Thanks for the feedback! I am glad that you find it useful. :D

Regarding your suggestion, interesting idea.
Two things come to my mind about that right now:
1) How do I let Windows save the WE windows position? I don't know. :veryconfused: :?:
2) Even if that could work, I find it quite dangerous. What if something goes wrong and the WE window is stuck off screen. Would be quite hard to debug and might have also other unwanted side effects. :? Since I guess that it is no real problem for most users if the original WE window visually pops up for a short moment, I think I would rather like to leave it like that. If it is a big problem for you, I might consider adding it to the list and maybe implementing it as a user option in the future (with low priority on the to-do list, unless you could convince me of it's importance). Please, let me know if it should be a very important problem for you. :ninja:

1024mb
Posts: 56
Joined: 14 Dec 2018 23:26

Re: [AHK] redirecting win explorer windows to XY

Post by 1024mb »

autocart wrote: 29 Apr 2020 16:22 You are super welcome. :tup: I was up until 4 a.m. just for you. :biggrin: Joke. Not really. Would have been up that long anyway. Besides, no problem regarding the time you took. I was then sleeping for the rest of the night/morning. :kidding: You must be located somewhere in the Americanas, because of the time and because of Spanish. I am located in Europe.

Regarding the IDM software, although the script works for you now, for future reference I want to emphazise again that the software which opens Windows Explorer has no effect on the script's working what so ever. It does not matter which software it is. Therefore I would never have need to try installing a software just to open WE, because it would not make any difference.

I am glad, that it works now. Thx for the feedback. :D

Thanks also for the Spanish words. I will add them as further suggestions to the code. :tup:

BTW, did you notice the optional RegEx-compare method? It is much more powerful than stating all those keywords. E.g. I have my RegEx activated and am checking for regular paths (like "C:\path\folder" and only a few keywords, like "This PC") which I then let the script redirect. All other stuff is *not* redirected. This way I don't have to care about all these keywords as exceptions, and it is impossible for me to "miss" or forget any keywords. Just saying. :whistle: :)
Yes, you are right, I'm in South America :mrgreen: .
Thanks for clarifying that, I was thinking that maybe IDM used some kind of spaghetti code/method to open paths but it seems I was wrong.

About regex, yep, I saw the examples and the script comments but I thought that maybe it wasn't working correctly or something as the other exclusions weren't regex but plain strings.
I have now added a regex to exclude all special names from being redirected but I can't figure out how to not redirect Quick Access, or in fact why is it being redirected.
Everything else is working right, Control Panel is not being redirected, if I open This PC properties it doesn't redirect it to XYplorer, and so on.

This is what I'm using:

Code: Select all

^(\w|\s|[Á-Úá-ú]|\\)+$
- In my case "Quick Access" is "Acceso rápido".

Thanks again! :cup:

autocart
Posts: 839
Joined: 26 Sep 2013 15:22

Re: [AHK] redirecting win explorer windows to XY

Post by autocart »

1024mb wrote: 29 Apr 2020 22:54... Quick Access, or in fact why is it being redirected.
...
This is what I'm using:

Code: Select all

^(\w|\s|[Á-Úá-ú]|\\)+$
- In my case "Quick Access" is "Acceso rápido".
When Quick Access is redirected, can you then copy the content of the address bar in XY, please. And paste it here. Thx.

1024mb
Posts: 56
Joined: 14 Dec 2018 23:26

Re: [AHK] redirecting win explorer windows to XY

Post by 1024mb »

autocart wrote: 29 Apr 2020 23:10
1024mb wrote: 29 Apr 2020 22:54... Quick Access, or in fact why is it being redirected.
...
This is what I'm using:

Code: Select all

^(\w|\s|[Á-Úá-ú]|\\)+$
- In my case "Quick Access" is "Acceso rápido".
When Quick Access is redirected, can you then copy the content of the address bar in XY, please. And paste it here. Thx.
Sure, here it is:

Code: Select all

C:\Programas\XYplorer\Acceso rápido
I have XYplorer installed on C:\Programas instead of Program Files.

To open Quick access you have to run "File Explorer" from the start menu, at least that's what I think is named in English, in Spanish is "Explorador de archivos".

autocart
Posts: 839
Joined: 26 Sep 2013 15:22

Re: [AHK] redirecting win explorer windows to XY

Post by autocart »

Hmmm :maf:

^(\w|\s|[Á-Úá-ú]|\\)+$
is in the variable vWindowsExplorerPaths, correct?

vKeepOrRedirect_matchingWEPaths := "Keep"
vUseRegExForPathCompare := 1

And what does the variable vExceptionPathsInCaseOfRegEx contain?

BTW, found out that "Acceso rápido" must be the "Favorites".

1024mb
Posts: 56
Joined: 14 Dec 2018 23:26

Re: [AHK] redirecting win explorer windows to XY

Post by 1024mb »

autocart wrote: 29 Apr 2020 23:35 Hmmm :maf:

^(\w|\s|[Á-Úá-ú]|\\)+$
is in the variable vWindowsExplorerPaths, correct?
Yes, I have it like this:

Code: Select all

vWindowsExplorerPaths := "^(\w|\s|[Á-Úá-ú]|\\)+$"
autocart wrote: 29 Apr 2020 23:35vKeepOrRedirect_matchingWEPaths := "Keep"
vUseRegExForPathCompare := 1
Yes.
autocart wrote: 29 Apr 2020 23:35And what does the variable vExceptionPathsInCaseOfRegEx contain?
This is what it contains:

Code: Select all

vExceptionPathsInCaseOfRegEx := "\.zip$"
Which I think is the default as I haven't edited that.

Is weird that everything else is not being redirected :?: . I've made a video showing what I do and what happens: https://send.firefox.com/download/0b703 ... S5ojc3n8hg

autocart
Posts: 839
Joined: 26 Sep 2013 15:22

Re: [AHK] redirecting win explorer windows to XY

Post by autocart »

Cool testing, even with a video!

Just to get the facts straight:
The first time it is redirected (of course without finding the path in XY).
The second time it is not redirected?
By accident, are you holding down the Control key during the second time?

1024mb
Posts: 56
Joined: 14 Dec 2018 23:26

Re: [AHK] redirecting win explorer windows to XY

Post by 1024mb »

autocart wrote: 30 Apr 2020 01:16 Cool testing, even with a video!

Just to get the facts straight:
The first time it is redirected (of course without finding the path in XY).
The second time it is not redirected?
By accident, are you holding down the Control key during the second time?
Oh, yes, I should have been clear :biggrin: . First time I don't hold Ctrl, second time I'm holding Ctrl.

autocart
Posts: 839
Joined: 26 Sep 2013 15:22

Re: [AHK] redirecting win explorer windows to XY

Post by autocart »

Do any of the other keyword-paths which do *not* get redirected also contain an á?
At the moment I do not have a real clue. Sorry, but I'll keep thinking about it.

1024mb
Posts: 56
Joined: 14 Dec 2018 23:26

Re: [AHK] redirecting win explorer windows to XY

Post by 1024mb »

autocart wrote: 30 Apr 2020 01:37 Do any of the other keyword-paths which do *not* get redirected also contain an á?
At the moment I do not have a real clue. Sorry, but I'll keep thinking about it.
You are right, paths with accented characters aren't excluded. I tried with "Panel de control\Sistema y seguridad\Opciones de energía" by right-clicking it and choosing "Open in new window" and the script redirected it to M$'s explorer. Now the question is why the accented characters are being skipped from the regex? I even tried splitting it like

Code: Select all

[Á-Ú]|[á-ú]
but it didn't fixed it.

autocart
Posts: 839
Joined: 26 Sep 2013 15:22

Re: [AHK] redirecting win explorer windows to XY

Post by autocart »

Alrighty!
I found the culprit. The script file itself must be saved in UTF-8 format WITH BOM. Before it was saved without BOM, which caused the non-ascii chars to be processed incorrectly. :roll:

New Update in 1st post.
Version 3.4.1
viewtopic.php?f=7&t=10671

1024mb
Posts: 56
Joined: 14 Dec 2018 23:26

Re: [AHK] redirecting win explorer windows to XY

Post by 1024mb »

autocart wrote: 30 Apr 2020 02:33 Alrighty!
I found the culprit. The script file itself must be saved in UTF-8 format WITH BOM. Before it was saved without BOM, which caused the non-ascii chars to be processed incorrectly. :roll:

New Update in 1st post.
Version 3.4.1
viewtopic.php?f=7&t=10671
Thanks!!

Now that you solved all the problems I want to request something.
As the script includes user customization it would be great if you could use #include to embed external files so we could have our configuration in something like user_config.txt. I've already tested this and it works well.

It should look like:

Code: Select all

#Include user_config.txt
Edit: I should say that if this is used the problem with accented characters returns. So... better don't add it :biggrin:

Thank you again! :beer:

autocart
Posts: 839
Joined: 26 Sep 2013 15:22

Re: [AHK] redirecting win explorer windows to XY

Post by autocart »

1024mb wrote: 30 Apr 2020 03:35Now that you solved all the problems I want to request something.
LOL :biggrin: :biggrin: That made me laugh. I am at least glad that it works now. :D
1024mb wrote: 30 Apr 2020 03:35As the script includes user customization it would be great if you could use #include to embed external files so we could have our configuration in something like user_config.txt. I've already tested this and it works well.

It should look like:

Code: Select all

#Include user_config.txt
Thank you again! :beer:
I really like this idea. Simple, effective and efficient. I want to do it but not sure when I'll have time again. The next days could be busy with other things... let's see. Thanks for the idea and for testing. :beer:

Post Reply