[program-l] Re: AutoHotKey and File Explorer

  • From: Mike Fox <mfox32322@xxxxxxxxx>
  • To: program-l@xxxxxxxxxxxxx
  • Date: Fri, 7 Jun 2019 12:11:46 -0400

Yeah, AHK is great for stuff like that. I just know it inside out and backwards 
because we used to use it at work. I’m not sure why your heart key didn’t work, 
but I usually go with shifts and control rather than control adults. And that’s 
mostly because control an old are used for iOS functions, like control alt 
delete or (If you don’t have a screen reader running) control alt arrows. I 
kind of discovered that one by accident 😆 (it messes with the monitor’s 
orientation ).  Anyway, glad to hear you got your script working.

Sent from my iPhone

On Jun 7, 2019, at 10:06 AM, Travis Roth <travis@xxxxxxxxxxxxxx> wrote:

Hey Mike,
Thanks for your response.
I did some troubleshooting on this. It appears that the #IfWinActive 
statement was not the issue. At least on this system it seems some hot keys 
will register and some will not.
I was testing with ^!c (ctrl+alt+c) and this failed. I changed the keystroke 
to ^+i and it started working. So I don’t’ know what is up with that perhaps 
only some types of hotkeys can work inside conditionals? That doesn’t’ make 
sense to me…  But anyways it is something I can work around.
I’m using Ahk 1.1.25 on Windows 10. I’ve not checked if there is a newer 
version of this in awhile, I should do that. Overall I’m not a big Ahk 
user/expert, just want it to do the occasional small task.
 
 
From: program-l-bounce@xxxxxxxxxxxxx <program-l-bounce@xxxxxxxxxxxxx> On 
Behalf Of Mike Fox
Sent: Thursday, June 6, 2019 8:38 PM
To: program-l@xxxxxxxxxxxxx
Subject: [program-l] Re: AutoHotKey and File Explorer
 
Hey Travis,
 
What version of AutoHotKey are you using, and what version of Windows?
I have Windows 10 64-bit, and AHK version 1.1.25.01 Unicode 32-bit, and this 
code worked for me:
 
#ifWinActive ahk_class CabinetWClass`
^p::
MsgBox Yup, it works!
return
 
If I hit Control P in Notepad, I got a print dialog.  If I hit it in File 
Explorer, no matter what directory it was on, I got my message box and no 
print dialog.
 
So without seeing any of your code, I don't see a reason why the #ifWinActive 
directive wouldn't work.  Could it be that the hotkey is working, but the 
code it calls is going wrong?  Hard to tell with no code, but hopefully my 
little test script will help you debug it. :)
 
 
On Thu, Jun 6, 2019 at 8:56 AM Travis Roth <travis@xxxxxxxxxxxxxx> wrote:
Hi, 
Any AutoHotKey experts here?
I am trying to make a hot key that is only active in File Explorer. 
According to Stack Overflow this directive should work: 
#IfWinActive ahk_class CabinetWClass

I also confirmed that the CabinetWClass window class still does exist as the
top window in File Explorer. 
However, this is not working for me and my hot key never becomes active. 
Anyone know the solution? 
Thanks.
Travis


** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: