• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 37
  • Last Modified:

Need Hotkeys script

Can someone please help me with a Hotkeys script to open a new folder wherever the courser happens to be.  In other words it could be on the desktop or an explorer window.  The Windows shortcut is Control/Shift N or ^, +, N.  I haven't been able to make it work for me.
Thanks
0
camtz
Asked:
camtz
  • 3
  • 2
1 Solution
 
Joe Winograd, Fellow&MVEDeveloperCommented:
Hi Carlos,
a Hotkeys script
I presume you mean an AutoHotkey script, but if not, let me know. That said, you don't really need an AutoHotkey script for it because Shift+Ctrl+N works when the cursor is (1) in Windows/File Explorer, creating a new subfolder in the folder where it is and (2) on the desktop, creating a new folder on the desktop. Regards, Joe
0
 
camtzAuthor Commented:
I know but I'm lazy.  I want to be able to hit control n and have a new folder.  I tough you could somehow use the Windows shortcuts in AutoHotkeys.  Thanks Joe.  Good to hear from you again.
0
 
Joe Winograd, Fellow&MVEDeveloperCommented:
I want to be able to hit control n and have a new folder.
OK, no problem. I presume that you already have an AutoHotkey script that runs at Windows start-up and contains your hotkeys and hotstrings. Just add this one to it:

$^n::Send +^n
Return

Open in new window

That will send Shift+Ctrl+N whenever you hit Ctrl+N. Regards, Joe
0
 
camtzAuthor Commented:
Boy you know your stuff.  Works like a charm.  Many, many thanks
0
 
Joe Winograd, Fellow&MVEDeveloperCommented:
You're welcome, Carlos. One other thing that just occurred to me. You may want to use Ctrl+N in that way only on the desktop and in Windows/File Explorer, since other programs are likely to use Ctrl+N differently. So you'll need an enhanced hotkey that sends Shift+Ctrl+N only when in Windows/File Explorer (ActiveClass="CabinetWClass") or on the desktop (ActiveClass="Progman"); in all other cases, it sends just Ctrl+N. Here's the enhanced code:

$^n::
WinGetClass,ActiveClass,A
If ((ActiveClass="CabinetWClass") or (ActiveClass="Progman"))
  Send +^n
Else
  Send ^n
Return

Open in new window

Regards, Joe
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now