AutoHotkey Community

It is currently May 27th, 2012, 6:16 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: December 3rd, 2007, 2:54 pm 
Offline

Joined: November 17th, 2006, 8:40 am
Posts: 10
Whenever I right click on Autohotkey TRAY icon and click on "edit this script"; I always get the AHk script in notepad.
How do I change these default settings to open the script in Textpad ??


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 3rd, 2007, 3:43 pm 
You can change this in your registry.

1. Open the registry editor: Click on run in your start menu and enter regedit and press enter
2. Scroll to the folder HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit\Command
3. Double click on (Default) in the right pane
4. Change c:\windows\system32\notepad.exe to your preferred editor. I'm using PsPad: "c:\Program Files\PSPad editor\PSPad.exe" "%1" (All quotes included). The "%1%" is important, because windows replaced it by the file name you want to edit.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 6th, 2007, 10:44 am 
Offline

Joined: November 17th, 2006, 8:40 am
Posts: 10
Stefaan wrote:
You can change this in your registry.

1. Open the registry editor: Click on run in your start menu and enter regedit and press enter
2. Scroll to the folder HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit\Command
3. Double click on (Default) in the right pane
4. Change c:\windows\system32\notepad.exe to your preferred editor. I'm using PsPad: "c:\Program Files\PSPad editor\PSPad.exe" "%1" (All quotes included). The "%1%" is important, because windows replaced it by the file name you want to edit.



Thanks a Lot !


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 6th, 2007, 12:19 pm 
copy paste into a regfile

I like notepad++ as the best ahk editor since it understands its language (plugin)

Code:
REGEDIT4

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



Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 20th, 2008, 3:49 pm 
Offline

Joined: December 6th, 2007, 4:21 pm
Posts: 32
I use notepad++, too. Thanks for this tip!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 23rd, 2009, 1:31 pm 
Offline

Joined: February 7th, 2009, 11:28 pm
Posts: 384
[warning: old thread!]

Is there a version of this tweak for Notepad2?

I have it located at C:\Program Files\Notepad2.exe, so I changed Lompsy's file to:
Code:
REGEDIT4

[HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit\Command]
@="C:\\Program Files\\Notepad2.exe %1"
(I had no previous default value)

it didn't work, not even after a reboot. I then added the extra quotes per bits suggestion to make the registry value "C:\Program Files\Notepad2.exe" "%1", but again no luck... though I haven't rebooted yet in case that's required.

[Edit2: I thought I figured it out, got it to work by changing HKEY_CLASSES_ROOT\.ahk from ahk_auto_file to AutoHotkeyScript, but that just opens all .ahk files with Notepad too instead of running them.]

_________________
Hardware: 1.8 GHz laptop with 4 GB ram, Windows XP/SP3
Software: Prevx, Privatefirewall, KeyScrambler.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2009, 1:10 pm 
Offline

Joined: July 31st, 2008, 10:27 pm
Posts: 336
This post left intentionally blank.


Last edited by Morpheus on March 12th, 2011, 7:41 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2009, 1:32 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
pajenn, sounds like the Open verb doesn't exist in the AutoHotkeyScript key. What Morpheus suggested will probably put it back, otherwise you could copy the "Shell\Open" (or similar) key from ahk_auto_file to AutoHotkeyScript.

I've found Types to be handy, especially in Windows Vista and 7, which don't allow that level of control through the standard UI.
Quote:
Source: Types
“Types” is a free and lightweight configuration utility for Windows that allows you to edit program associations, icons, context menus and other properties of various file types displayed in the Explorer.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2009, 11:53 pm 
Offline

Joined: February 7th, 2009, 11:28 pm
Posts: 384
UPDATE: Solved. Thanks for the suggestions.

The registry entry at HKEY_CLASSES_ROOT\.ahk seems to control the default action for .ahk files. i.e. runs them. Changing its value from ahk_auto_file to AutoHotkeyScript caused my .ahk files to open in Notepad2 instead of running when I double-clicked them.

Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.ahk]
@="ahk_auto_file"


The HKEY_CLASSES_ROOT\AutoHotkeyScript probably fixed or added the "Edit" option into the Explorer's right-click context menu for .ahk files, but not for "Edit This Script" in the in system tray menu.

The trick was to add the Shell\Edit\Command @="C:\Program Files\Notepad2.exe %1" into HKEY_CLASSES_ROOT\ahk_auto_file. Previously it only had an "Open" entry pointing to AutoHotkey.exe, but no "Edit" entry. Here's the .reg file for it:

Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\ahk_auto_file]
@=""

[HKEY_CLASSES_ROOT\ahk_auto_file\shell]

[HKEY_CLASSES_ROOT\ahk_auto_file\shell\Edit]

[HKEY_CLASSES_ROOT\ahk_auto_file\shell\Edit\Command]
@="\"C:\\Program Files\\Notepad2.exe\" \"%1\""

[HKEY_CLASSES_ROOT\ahk_auto_file\shell\open]

[HKEY_CLASSES_ROOT\ahk_auto_file\shell\open\command]
@="\"C:\\Program Files\\AutoHotkey\\AutoHotkey.exe\" \"%1\""


I also kept the AutoHotkeyScript additions (shown below), but I'm not sure if it's doing anything since the .ahk key doesn't reference it.

Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\AutoHotkeyScript]

[HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell]

[HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit]

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

_________________
Hardware: 1.8 GHz laptop with 4 GB ram, Windows XP/SP3
Software: Prevx, Privatefirewall, KeyScrambler.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 20th, 2010, 3:57 pm 
Offline

Joined: September 19th, 2005, 1:31 am
Posts: 115
Tearing my hair out over this one... it works on my other 2 computers (XP) fine, but my new Windows 7 keeps opening my ahk files with notepad to edit, instead of PS Pad...

Here's my Regedit files:

Code:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ahk_auto_file]
@=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ahk_auto_file\shell]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ahk_auto_file\shell\Edit]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ahk_auto_file\shell\Edit\Command]
@="\"C:\\Program Files (x86)\\PSPad editor\\PSPad.exe\" \"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ahk_auto_file\shell\open]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ahk_auto_file\shell\open\command]
@="\"C:\\Program Files (x86)\\AutoHotkey\\AutoHotkey.exe\" \"%1\""


Code:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AutoHotkeyScript]
@="AutoHotkey Script"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AutoHotkeyScript\DefaultIcon]
@="C:\\Program Files (x86)\\AutoHotkey\\AutoHotkey.exe,1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AutoHotkeyScript\Shell]
@="Open"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AutoHotkeyScript\Shell\Compile]
@="Compile Script"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AutoHotkeyScript\Shell\Compile\Command]
@="\"C:\\Program Files (x86)\\AutoHotkey\\Compiler\\Ahk2Exe.exe\" /in \"%l\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AutoHotkeyScript\Shell\Edit]
@="Edit Script"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AutoHotkeyScript\Shell\Edit\Command]
@="\"C:\\Program Files (x86)\\PSPad editor\\PSPad.exe\" \"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AutoHotkeyScript\Shell\Open]
@="Run Script"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AutoHotkeyScript\Shell\Open\Command]
@="\"C:\\Program Files (x86)\\AutoHotkey\\AutoHotkey.exe\" \"%1\" %*"


Any clue what's wrong?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 19th, 2011, 4:43 pm 
Offline

Joined: October 30th, 2005, 5:31 pm
Posts: 52
Location: Zurich, CH
I have the same problem on Win7 x64 as ProsperousOne ahs:
The registriy enties do not have any effect on "Edit this script" - it always opens NotePad with the script.
BTW HKEY_CLASSES_ROOT\.ahk points to AutoHotkeyScript (not to ahk_auto_file).

How to fix this?

_________________
Klaus Daube, www.daube.ch


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 19th, 2011, 5:05 pm 
Offline

Joined: February 15th, 2011, 9:39 am
Posts: 103
Is AHK reading these entries? Or is it being launched as a verb through ShellExecute? Either way, if you are running a 32-Bit version of AHK, it wouldn't hurt to try putting duplicated entries under the Wow6432Node sub key as well (i.e. HKEY_CLASSES_ROOT\Software\Wow6432Node\Classes instead of just HKEY_CLASSES_ROOT\Software\Classes).

EDIT: Actually, now that I think about it, it likely doesn't matter how AHK is launching the editor, even if it's through ShellExecute, since it will be the 32-Bit version of Shell32.dll anyway.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 19th, 2011, 10:29 pm 
Offline

Joined: October 30th, 2005, 5:31 pm
Posts: 52
Location: Zurich, CH
NoobSawce, yes my AHK version is 32 bit. Is there really a 64 bit version?
I have not found the branch HKEY_CLASSES_ROOT\Software\Wow6432Node\Classes (as You suggest to put copies in).
There is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\ahkfile\shell\Edit\Command which may just be a copy of the HKCLR branch.

Still confused, but on a higher level
Klaus

_________________
Klaus Daube, www.daube.ch


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 19th, 2011, 10:45 pm 
Offline

Joined: February 15th, 2011, 9:39 am
Posts: 103
The Wow6432Node is where Windows stores registry information for access from 32-Bit applications (since 32-Bit apps can't read 64-Bit keys), but you will only ever see it on x64 versions of Windows.

Also the second path you provided is just fine, so you can update the data there. It's actually the same location, it just gets merged with other keys and virtualized as HKCR. However, it is still the ultimate place where 32-Bit apps will get their data (read: have to go) to look up file association information, including the 32-Bit version of Shell32.

As far as 64-Bit versions of AHK go, only AHK_L provides 64-Bit versions (as well as Unicode versions). AHK basic only provides a 32-Bit version in ANSI. If your AutoHotkey.exe file version number is 1.0.48.05, then chances are it's the basic version.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 12th, 2011, 7:56 pm 
Offline

Joined: July 31st, 2008, 10:27 pm
Posts: 336
I'm using Win 7 Home Premium (64) and this worked for me:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AutoHotkeyScript\Shell\Edit\Command

Value = pspad.exe %1


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: hd0202, HotkeyStick and 52 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group