Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure Autohotkey to edit scripts with Notepad++

Tags:

I have my default editor for .ahk files set to Notepad++ Portable on my work laptop, but selecting Edit This Script opens files in the standard Windows Notepad.

A post on the AHK forums suggests editing the registry, but I don't see any entries under HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit\Command.

How can I configure AutoHotkey to edit scripts with Notepad++?

like image 254
Stevoisiak Avatar asked Aug 07 '17 17:08

Stevoisiak


People also ask

Can Notepad ++ be used for AutoHotkey?

Setup Notepad++ for AutoHotkey Save it to the right location: 32-Bit (C:\Program Files (x86)\Notepad++\) 64-Bit (C:\Program Files\Notepad++\) as User (%AppData%\Notepad++\)


2 Answers

For whatever reason, the Registry entry doesn't exist by default, but it is recognized by the application once created.

  1. Navigate to HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell in RegEdit.
  2. Right-click the Shell folder, select New > Key and name this Edit.
  3. Right-click the Edit folder, select New > Key and name this Command.
  4. Double click the (Default) string entry in Command.
  5. Paste in "C:\Program Files\Notepad++\Notepad++.exe" "%1" to this window.
  6. Reload AutoHotkey for the changes to take effect.

Note: I don't use Notepad++, but this works for VS Code on my system, and will for N++ as long as the directory information for the executable is correct.


The corresponding .reg file looks like this:

Windows Registry Editor Version 5.00  [HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit\Command] @="\"C:\\Program Files\\Notepad++\\notepad++.exe\" \"%1\"" 
like image 105
David Metcalfe Avatar answered Sep 21 '22 07:09

David Metcalfe


The registry entry in item 5 of the previous answer did not work. I don't even know what the extra %* at the end means, so I simplified it to:

"C:\Program Files\Notepad++\Notepad++.exe" "%1" 
like image 45
Bernie Eisenberg Avatar answered Sep 23 '22 07:09

Bernie Eisenberg