How to force edit in notepad++ only?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
newcod3r
Posts: 505
Joined: 30 Sep 2021, 02:16

How to force edit in notepad++ only?

Post by newcod3r » 26 Nov 2021, 22:00

I just switched to Win11, and notepad replacer no longer works.

How do I change it such that all edits are always made in notepad++?

Code: Select all

~^#a::edit

lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: How to force edit in notepad++ only?

Post by lexikos » 26 Nov 2021, 22:35

Your hotkey could just call Run instead of Edit.

To change the default editor for AutoHotkey scripts, change the default value of the registry key HKCR\AutoHotkeyScript\Shell\Edit\Command. The documentation for Edit contains an example script which does this for you.

newcod3r
Posts: 505
Joined: 30 Sep 2021, 02:16

Re: How to force edit in notepad++ only?

Post by newcod3r » 27 Nov 2021, 07:47

yes I prefer the regedit route. I inserted this and ran the .reg file, but it didn't work. Any idea why so?

Code: Select all

[HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit\Command]
@="\"C:\\Program Files\\Notepad++\\notepad++.exe\" \"%1\""

User avatar
mikeyww
Posts: 26848
Joined: 09 Sep 2014, 18:38

Re: How to force edit in notepad++ only?

Post by mikeyww » 27 Nov 2021, 08:01

You might want to try this one as well.

HKEY_CURRENT_USER\SOFTWARE\Classes\Applications\AutoHotkey.exe\shell\edit\command

newcod3r
Posts: 505
Joined: 30 Sep 2021, 02:16

Re: How to force edit in notepad++ only?

Post by newcod3r » 27 Nov 2021, 19:57

mikeyww wrote:
27 Nov 2021, 08:01
You might want to try this one as well.

HKEY_CURRENT_USER\SOFTWARE\Classes\Applications\AutoHotkey.exe\shell\edit\command
this worked. THANK YOU!

lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: How to force edit in notepad++ only?

Post by lexikos » 29 Nov 2021, 04:09

I suppose that might be necessary if you used "open with" to override the settings created by the installer. On my system, that key does not exist.

User avatar
mikeyww
Posts: 26848
Joined: 09 Sep 2014, 18:38

Re: How to force edit in notepad++ only?

Post by mikeyww » 29 Nov 2021, 05:23

That is probably what I did long ago, with the portable version.

kdodia
Posts: 1
Joined: 08 Feb 2022, 16:07
Contact:

Re: How to force edit in notepad++ only?

Post by kdodia » 08 Feb 2022, 16:29

mikeyww wrote:
27 Nov 2021, 08:01
You might want to try this one as well.

HKEY_CURRENT_USER\SOFTWARE\Classes\Applications\AutoHotkey.exe\shell\edit\command
I am grateful you took the time to share this. It was driving me nuts!!

I have opened an issue on GitHub to add this to the documentation: https://github.com/Lexikos/AutoHotkey_L-Docs/issues/532.

User avatar
mikeyww
Posts: 26848
Joined: 09 Sep 2014, 18:38

Re: How to force edit in notepad++ only?

Post by mikeyww » 08 Feb 2022, 17:31

Thanks for doing that. It might have just been a piece of information (registry key) that changed as Windows evolved into its latest versions.

Post Reply

Return to “Ask for Help (v1)”