ListHotKeys - VBS to PS1 conversion - Why doesn't the latter give me the pop-up?

britechguy

Well-Known Member
Reaction score
4,687
Location
Staunton, VA
Background: Individuals who are blind or low vision tend to assign hot keys to desktop shortcuts to a far greater extent than sighted individuals do (if they even know such exist). The NVDA screen reader assigns Ctrl + Alt + N as its hotkey, many people with JAWS will assign Ctrl + Alt + J, etc. This morning someone was asking about assigning Ctrl + Alt + F to Firefox, which works fine for me, but not for them. I've pretty much determined that something else must already have Ctrl + Alt + F assigned.

I found the following VBS script, which works like a charm: ListHotKeys.vbs

I thought, just for kicks, I'd ask Copilot to rewrite it in PowerShell, which it did: ListHotKeys.ps1

The interesting thing is that with the VBS version if I select and double click, I get the pop-up dialog that gives the list of hot keys in use and what's using them. If I do the same with the PS1 version, I get nothing and opens in Notepad. Yet, if I have that PS1 version selected, bring up the context menu and choose "Run with PowerShell," a PowerShell window opens, the dialog opens in front of it, and when I hit OK on the dialog, both it and the PowerShell window close.

I could have sworn when I was using PS1 files in the past that they acted just like BAT files do and just ran the code in them. I can't figure out why this one is opening for edit rather than just running.

Any insights welcome.
 
Back
Top