[AHK] redirecting Windows Explorer to XY

Discuss and share scripts and script files...
autocart
Posts: 1243
Joined: 26 Sep 2013 15:22

Re: [AHK] redirecting Windows Explorer to XY

Post by autocart »

You are very welcome. Thank you for your reply! :D
It is a lot of fun. Wish I had more time to work on it. 8)

AlternativeShit
Posts: 11
Joined: 18 Mar 2022 02:37

Re: [AHK] redirecting Windows Explorer to XY

Post by AlternativeShit »

Thanks for this script! It works great and it may very well be the reason why I keep using XYplorer :mrgreen:

However I have a question :

Let's say I, a complete newbie, who knows very little of script and of ahk, would want the script to run at startup.

How would one manage to do that, in really clear, noob friendly instructions ?

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

Re: [AHK] redirecting Windows Explorer to XY

Post by autocart »

AlternativeShit wrote: 29 Mar 2022 23:28 Thanks for this script! It works great and it may very well be the reason why I keep using XYplorer :mrgreen:
Thank you for the nice feedback.
AlternativeShit wrote: 29 Mar 2022 23:28 Let's say I ... would want the script to run at startup.
How would one manage to do that, in really clear, noob friendly instructions ?
Do you know how to make any "normal" exe file run at startup?

AlternativeShit
Posts: 11
Joined: 18 Mar 2022 02:37

Re: [AHK] redirecting Windows Explorer to XY

Post by AlternativeShit »

autocart wrote: 29 Mar 2022 23:35
AlternativeShit wrote: 29 Mar 2022 23:28 Thanks for this script! It works great and it may very well be the reason why I keep using XYplorer :mrgreen:
Thank you for the nice feedback.
AlternativeShit wrote: 29 Mar 2022 23:28 Let's say I ... would want the script to run at startup.
How would one manage to do that, in really clear, noob friendly instructions ?
Do you know how to make any "normal" exe file run at startup?
Oh it's the same?
Shortcut in Startup folder and done?

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

Re: [AHK] redirecting Windows Explorer to XY

Post by autocart »

If you have AutoHotkey installed and set to run ahk files as standard action on double click (which is the default), then yes.

AlternativeShit
Posts: 11
Joined: 18 Mar 2022 02:37

Re: [AHK] redirecting Windows Explorer to XY

Post by AlternativeShit »

autocart wrote: 30 Mar 2022 00:02 If you have AutoHotkey installed and set to run ahk files as standard action on double click (which is the default), then yes.
I have AutoHotkey installed, and didn't change any settings.

But it doesn't seem to work ?


Horst
Posts: 1080
Joined: 24 Jan 2021 12:27
Location: Germany

Re: [AHK] redirecting Windows Explorer to XY

Post by Horst »

I prefer to install Autohotkey and compile the scripts.
The resulting exe can be handled like any other tool.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3235)
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69

Norn
Posts: 415
Joined: 24 Oct 2021 16:10

Re: [AHK] redirecting Windows Explorer to XY

Post by Norn »

Attachments
Run & Kill AHK.png
Run & Kill AHK.png (23.88 KiB) Viewed 5622 times
Win10, Win11 @100% 2560x1440 22H2

Horst
Posts: 1080
Joined: 24 Jan 2021 12:27
Location: Germany

Re: [AHK] redirecting Windows Explorer to XY

Post by Horst »

Why should one take that complicated way ?
There is no benefit compared to compiling a script.
You compile it once and run it as a normal tool.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3235)
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69

AlternativeShit
Posts: 11
Joined: 18 Mar 2022 02:37

Re: [AHK] redirecting Windows Explorer to XY

Post by AlternativeShit »

autocart wrote: 31 Mar 2022 06:55 https://windowsloop.com/run-autohotkey- ... -startup/
Or google for "how to autostart autohotkey script".
Must have done something wrong, but now it works...
Thanks for the quick reply, and thanks for making this really useful script :biggrin:

Norn
Posts: 415
Joined: 24 Oct 2021 16:10

Re: [AHK] redirecting Windows Explorer to XY

Post by Norn »

Horst wrote: 31 Mar 2022 18:18
Why should one take that complicated way ?
There is no benefit compared to compiling a script.
You compile it once and run it as a normal tool.
This is the only way I know to open multiple files...
Win10, Win11 @100% 2560x1440 22H2

Horst
Posts: 1080
Joined: 24 Jan 2021 12:27
Location: Germany

Re: [AHK] redirecting Windows Explorer to XY

Post by Horst »

Norn wrote: 02 Apr 2022 17:13
Horst wrote: 31 Mar 2022 18:18
Why should one take that complicated way ?
There is no benefit compared to compiling a script.
You compile it once and run it as a normal tool.
This is the only way I know to open multiple files...
Whats the diff compared to a batch which starts all the compiled scripts ?
If I always want to run more than one AHK script continuesly I merge it into one.
I can run any number of AHK scripts in a QAP (Quick Access PopUp) group.
Autohotkey is installed of course.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3235)
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69

Norn
Posts: 415
Joined: 24 Oct 2021 16:10

Re: [AHK] redirecting Windows Explorer to XY

Post by Norn »

Thanks for your idea. I'll try it sometime.
Win10, Win11 @100% 2560x1440 22H2

WirlyWirly
Posts: 195
Joined: 21 Oct 2020 23:33
Location: Through the Looking-Glass

Re: [AHK] redirecting Windows Explorer to XY

Post by WirlyWirly »

Since I started using XY, I also have a few AHK scripts I like to run all at once. The approach I've taken is to use a custom toolbar button with a simple script. When I left-click the button it runs 3 scripts that I use with XY.

Here's my code for that button if you'd like to adapt it. Just paste this code into the multi-line edit screen of a custom toolbar button. Respect the indenting, it's important...

Left-Click

Code: Select all

    $AUTOHOTKEY = "<xypath>..\..\AutoHotkeyPortable\AutoHotkeyPortable.exe";
    $SCRIPTS = "<xypath>..\..\_programs_\AutoHotKey\";

    run lax("$AUTOHOTKEY" "$SCRIPTS\Vim-Like\Vim-Like.ahk");
    run lax("$AUTOHOTKEY" "$SCRIPTS\QuickSwitch\QuickSwitch.ahk");
    run lax("$AUTOHOTKEY" "$SCRIPTS\redirectWEwindowsToXY\redirectWEwindowsToXY.ahk");
Since I use AutoHotkeyPortable, I don't have AHK in my path, so I need to specify where the .exe file is in order to run my scripts. That's what the $AUTOHOTKEY variable does. You can omit this if AHK is in your path, which seems to be the case based on your code snippet. The $SCRIPTS variable is the folder that contains my scripts.

Here's the adaption of the command you use to kill the process, you can assign it to right/middle click...

Code: Select all

run lax("taskkill" "/f" "/im" "AutoHotkey.exe");
Also, @autocart, thanks a bunch for this script! I've been using it for months with no issues. If I had to make a suggestion it would be to standardize the .ahk filename going forward. Having the version number in the docstring is standard, regular changes to the filename break scripts such as this little toolbar script. Not a big deal and an easy fix for the end user, but just thought I'd mention it.

Keeping a .log file for the version info and other stuff might be useful too. With syntax highlighting it's easy to tell where comments end, but for people who don't use such an editor big blocks of comments can make it difficult to navigate.

My 2cents anyways, thanks again!

Post Reply