AutoHotkey Scripts

Discuss and share scripts and script files...
TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

AutoHotkey Scripts

Post by TheQwerty »

Well I know this forum is for XY scripts, but I thought I'd share my Autohotkey script here as well, so this is a collection of hotkeys I use with XY.

This one works regardless of the active window:
  • Win+E
  • Runs or Activates (restores from notification area) XY.
  • This must be updated with the path to XYplorer to function properly.*
The following only work when XY is the active window:
  • Ctrl+Shift+Backspace
  • This is the same as Ctrl+Shift+Left followed by Backspace.
  • This is useful in the address bar where Ctrl+Left will ignore spaces and jump to the directory separator, but Ctrl+Backspace does not.
  • Tab / Shift+Tab
  • When on a control with an auto-complete or MRU list this will make Tab/Shift+Tab act as Down/Up, but only if the list is visible.
  • Ctrl+Left Click or Double Left Click
  • Breadcrumb navigation: When done on a part of the path shown in the address bar it navigates to that folder.
Enjoy! :D


Updates:
  • 2009-11-11 -
    • Updated list of auto-complete list controls.
    • Fixed breadcrumb hotkeys.
    • Fixed Ctrl+Left click outside of address bar.
    • Removed Ctrl+K (this can be handled by XY now).
    • Removed WheelUp/Down (this is handled by XY now).
  • 2008-09-17 - Added CKS Category box to list of controls to ignore mouse wheel (unless list is visible).
  • 2008-08-21 -
    • Added Address Bar Breadcrumb navigation via Ctrl+Left or Double Left Click.
    • Updated list of control names that have an MRU/Auto-Complete list.
  • 2008-08-11 - Removed Ctrl+F8 and Ctrl+Shift+F8. See here for details and here for XYS replacement.
  • 2008-07-29 - Added Ctrl+F8 and Ctrl+Shift+F8.
Last edited by TheQwerty on 11 Nov 2009 16:19, edited 6 times in total.

avsfan
Posts: 554
Joined: 29 Jun 2006 09:00
Location: Fort Collins, Colorado

Post by avsfan »

Thanks -- this is GREAT (especially having the scrollwheel NOT change my address bar -- that has always been annoying!)

I definitely need to look more into AHK -- it looks VERY powerful (and when combined with XY, it looks like there could be some *really* neat things coming along...)

Thanks again!

lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Re: AutoHotkey Scripts

Post by lukescammell »

No wonder I gave up on trying to get XY to restore from the tray, that's some serious coding going on there (to the eyes of a cut'n'paste coder like myself :D).

In the end I settled for disabling XY from minimising to the tray and used this little gem:

Code: Select all

;
; Single Instance Apps
; With HotKeys
;

; XYplorer
#x::
Process, Exist, XYplorer.exe
IfWinActive, ahk_pid %ErrorLevel%
  WinMinimize
else
{
IfWinExist, ahk_pid %ErrorLevel%
  WinActivate
else
  Run, ..\..\XYplorer\XYplorer.exe
}
return
Oh yeah, and pressing Win+X again minimises the app as well, which is nice :) Have a play!
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

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

Re: AutoHotkey Scripts

Post by TheQwerty »

Does anyone actually use the scripts I posted?
Just trying to get an idea of whether or not I should bother keeping it updated for someone. :P

joshuawood
Posts: 10
Joined: 11 Nov 2009 07:30

Re: AutoHotkey Scripts

Post by joshuawood »

Hi,

The breadcrumb navigation option using the mouse doesn't work for me. Any ideas?

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

Re: AutoHotkey Scripts

Post by TheQwerty »

That's cause as my last post implies I haven't been keeping it up to date. :P
In fact it's twice removed at this point, my working copy differs from the repository, and the copy I use is still different from those.

If you feel comfortable making two simple changes all you have to do is in XY-Hotkeys.ahk go to the definitions for "Ctrl & LButton" and "LBCounter:" and change:

Code: Select all

if (focus == "Edit6") {
to

Code: Select all

if (focus == "Edit2") {

Otherwise I guess I'll try to clean up and update the script but I'm not sure how soon that will be.
EDIT: Okay, made that change and a few others, hopefully I didn't break anything as well. 8)

lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Re: AutoHotkey Scripts

Post by lukescammell »

TheQwerty wrote:The following only work when XY is the active window:
  • Ctrl+Shift+Backspace
  • This is the same as Ctrl+Shift+Left followed by Backspace.
    This is useful in the address bar where Ctrl+Left will ignore spaces and jump to the directory separator, but Ctrl+Backspace does not.
Bloody useful if I may say so! It's such a sensible addition, perhaps Don could add this to core? ;)
TheQwerty wrote:
    • Tab / Shift+Tab
    • When on a control with an auto-complete or MRU list this will make Tab/Shift+Tab act as Down/Up, but only if the list is visible.
Doesn't seem to work for me with XY 8.60.0199, Vista Business SP2 x64...
TheQwerty wrote:
  • Ctrl+Left Click or Double Left Click
  • Breadcrumb navigation: When done on a part of the path shown in the address bar it navigates to that folder.
[/list]
Very nice, thanks! This is actually one of the few things that I really like in the Vista changes to Windows Explorer, and this brings it a little bit closer.
TheQwerty wrote:Enjoy! :D
Thanks ;)
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Re: AutoHotkey Scripts

Post by lukescammell »

I've been mucking around with your script a bit and decided to add a little something extra (to XY-Hotkeys.ahk), which I know has been mentioned around these parts before (and probably is explained somewhere else as well, but hey, I couldn't find it...).

Code: Select all

;ALT+D selects the Address Bar (AB)
!d::
	ControlFocus, Edit2
	return
To be honest, this is a default windows shortcut, so should be in XY anyway, but until it is... ;)

If you want to use that little snippet without the rest of TheQwerty's excellent script, use the following:

Code: Select all

#IfWinActive ahk_class ThunderRT6FormDC
;ALT+D selects the Address Bar (AB)
!d::
	ControlFocus, Edit2
	return
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

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

Re: AutoHotkey Scripts

Post by TheQwerty »

Glad to see it's getting some use... :D
lukescammell wrote:Bloody useful if I may say so! It's such a sensible addition, perhaps Don could add this to core? ;)
I had pushed Don to add this but he said he couldn't get enough control over the backspace key when used in an edit field. Maybe eventually it will happen...
lukescammell wrote:Doesn't seem to work for me with XY 8.60.0199, Vista Business SP2 x64...
Does this still not work for you? I'll take a deeper look into it, but I believe it was working just fine in Vista previously. XY does seem to be picky about how Tab gets sent to it, but that shouldn't really affect the intended action.
lukescammell wrote:ALT+D selects the Address Bar (AB)...
It would probably be easier for you if you used XY's Customize Keyboard Shortcuts to achieve this. Just assign the shortcut to "Miscellaneous / Focus Functions / Focus Address Bar." Then if/when the address bar gets changed you don't have to update the AHK script (and you don't have to worry about any possible conflicts between XY and AHK).

lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Re: AutoHotkey Scripts

Post by lukescammell »

TheQwerty wrote:Glad to see it's getting some use... :D
lukescammell wrote:Bloody useful if I may say so! It's such a sensible addition, perhaps Don could add this to core? ;)
I had pushed Don to add this but he said he couldn't get enough control over the backspace key when used in an edit field. Maybe eventually it will happen...
/me holds his breath

Oh wait, that's not a good idea :D
TheQwerty wrote:
lukescammell wrote:Doesn't seem to work for me with XY 8.60.0199, Vista Business SP2 x64...
Does this still not work for you? I'll take a deeper look into it, but I believe it was working just fine in Vista previously. XY does seem to be picky about how Tab gets sent to it, but that shouldn't really affect the intended action.
Just tried it with 8.70.0100 and it's working on the MRU for Set Visual Filter (CTRL+J in list view), but it's still not working for me in the AB. Perhaps the AB is "different"?
TheQwerty wrote:
lukescammell wrote:ALT+D selects the Address Bar (AB)...
It would probably be easier for you if you used XY's Customize Keyboard Shortcuts to achieve this. Just assign the shortcut to "Miscellaneous / Focus Functions / Focus Address Bar." Then if/when the address bar gets changed you don't have to update the AHK script (and you don't have to worry about any possible conflicts between XY and AHK).
Ah! I thought it must be possible using CKS, but frankly, they're not entirely user friendly when trying to find a command that you do not know 100% exists or where in the menus it's been put/moved to - if only there was an option to search by the CKS and/or the command. That would make using CKS a cinch.

Also, I'm finding that the activate/restore/minimise isn't 100% - it just seems to minimse, not restore and seems to work better for me using the following:

Code: Select all

;--------------------------------------------------------------------------------
;ALL WINS
;--------------------------------------------------------------------------------
#IfWinExist

;Win+X, Run, Activate, or Minimize XYplorer.
#x::
	Process, Exist, xyplorer.exe
	IfWinActive, ahk_pid %ErrorLevel%
	{
		WinMinimize A
	} else {
		RunOrActivate("..\XYplorer\XYplorer.exe","","ThunderRT6FormDC", "left")
	}
	return
There's probably some problems with that code since I don't really understand your code =D and I've just hacked a bit out of something that already worked for me... In fact, the restore from system tray doesn't seem to function for me no matter what I do. I thought it might even be the relative path, but it doesn't even work with a full path...
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Re: AutoHotkey Scripts

Post by lukescammell »

Oh, and here's a handy little script I came across and modified:

Code: Select all

;-------------------------------------------------------------------------------
; Auto-Reload AutoHotKey when this file is saved
; http://prxbx.com/forums/showthread.php?tid=1181
; Modified 2009-12-09 11:32:17 by Luke Scammell - luke {at} scammell [dot] co (.) uk
; Modified to match any window with .ahk in the title, meaning it will update other scripts as well and from other programs like Notepad++ :)
~^s::
SetTitleMatchMode, 2
IfWinActive, .ahk
{
   Send, ^s
   SplashTextOn,,,Updated script,
   Sleep,500
   SplashTextOff
   Reload
}
else
   Send, ^s
return
;------------------------------------------------------------------------------/
Just dump that at the bottom of XY-Hotkeys.ahk and away you go ;)
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

RalphM
Posts: 1935
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: AutoHotkey Scripts

Post by RalphM »

Completely OT!
@lukescammell: Your family seems to be growing... congrats anyway. :D
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

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

Re: AutoHotkey Scripts

Post by TheQwerty »

lukescammell wrote:Just tried it with 8.70.0100 and it's working on the MRU for Set Visual Filter (CTRL+J in list view), but it's still not working for me in the AB. Perhaps the AB is "different"?
Meh.. I'm going to have to spend some time on this. When I first wrote it the only way I could reliably detect the list as displayed was by looking for its border. They've changed the style in Vista (and maybe again in 7), so that no longer works. I could probably just take another snapshot of the new border style, but I'd prefer to fix it properly.

lukescammell wrote:Also, I'm finding that the activate/restore/minimise isn't 100% - it just seems to minimse, not restore and seems to work better for me using the following
Well I can understand why it doesn't restore from the tray as that was always hacky and Microsoft did change up the notification area in 7. I see no reason that checking for the process would work any better there but it does seem like XY doesn't send it to the tray when AHK executes WinMinimize (I still get it minimizing the window just to the taskbar instead).

I think instead of putting my time into trying to fix this we could probably convince Don to modify this tweak to hide XY when it's executed while XY is active, or maybe add a new global hotkey for Show/Hide XY.
; Tweak: one char (A-Z, 0-9) used for hotkey Win+[ ] to show app
HotKeyShowApp=
Don how about some help getting rid of some of these hacky scripts? Please! :cry:

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

Re: AutoHotkey Scripts

Post by admin »

TheQwerty wrote:Don how about some help getting rid of some of these hacky scripts? Please! :cry:
Hmm, tell me what the scripts are about (sorry but no time currently to deep-follow every thread).

lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Re: AutoHotkey Scripts

Post by lukescammell »

TheQwerty wrote:
lukescammell wrote:Just tried it with 8.70.0100 and it's working on the MRU for Set Visual Filter (CTRL+J in list view), but it's still not working for me in the AB. Perhaps the AB is "different"?
Meh.. I'm going to have to spend some time on this. When I first wrote it the only way I could reliably detect the list as displayed was by looking for its border. They've changed the style in Vista (and maybe again in 7), so that no longer works. I could probably just take another snapshot of the new border style, but I'd prefer to fix it properly.
Actually, the behaviour's the at work (Vista Business SP2 x64) I'd need to confirm at home...
TheQwerty wrote:
lukescammell wrote:Also, I'm finding that the activate/restore/minimise isn't 100% - it just seems to minimse, not restore and seems to work better for me using the following
Well I can understand why it doesn't restore from the tray as that was always hacky and Microsoft did change up the notification area in 7. I see no reason that checking for the process would work any better there but it does seem like XY doesn't send it to the tray when AHK executes WinMinimize (I still get it minimizing the window just to the taskbar instead).
Again, I'm mainly writing from the perspective of Vista right now, I should have made myself clearer. I don't suppose the Vista shortcut of WIN+B to select the system tray is at all useful? (haven't tired the shortcut on Win7 yet...)
TheQwerty wrote:I think instead of putting my time into trying to fix this we could probably convince Don to modify this tweak to hide XY when it's executed while XY is active, or maybe add a new global hotkey for Show/Hide XY.
; Tweak: one char (A-Z, 0-9) used for hotkey Win+[ ] to show app
HotKeyShowApp=
Just make it an option in UDCs under misc ;) Then you can use whatever shortcut you like (within reason).
RalphM wrote:Completely OT!
@lukescammell: Your family seems to be growing... congrats anyway. :D
Cheers! Let's hope it doesn't grow any more now eh? ;)
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

Post Reply