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!