Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Easy Edit/Manage Hotkeys/Hotstrings Plugin [AHK_L]


  • Please log in to reply
17 replies to this topic
shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006
Hotkeys/Hotstrings Script manager
Posted Image

Description:
[*:2ng2ldl8] Add/Edit Hotkeys & Hotstrings
[*:2ng2ldl8] Delete Hotkeys & Hotstrings
[*:2ng2ldl8] View all Hotkeys & Hotstrings
How to setup:

For new users or those who just want to try the script:
1. Copy HotManager.ahk to a new folder.
2. Run it! :)For users already using a "main" or "master" script (plugin mode):
1. Copy HotManager.ahk to same folder as your main script.
2. Backup your main script.
3. Add the following hotkey to your main script
#H::Run %A_AhkPath% HotManager.ahk "%A_ScriptFullPath%", %A_scriptdir%,, hotkeysman    ;HOTKEYS MANAGER
4. Add the following code to your exit routine.
if hotkeysman           ; If hotkeys manager exists
  winkill, ahk_pid %hotkeysman%
ExitApp
Known "bugs":
[*:2ng2ldl8] Some hotkeys and hotstrings may contain misc code/other functions. The script has no way to know when a hotkey or hotstring code ends. Hence, be extremely careful when deleting an entry from the list.
[*:2ng2ldl8]Does not yet support " :*: " type hotstrings
[*:2ng2ldl8]Does not yet list Hotkey command hotkeys, only the old type supported
[*:2ng2ldl8]AHK_L only for now, as it uses objects to store data
HotManager.ahk (better still, download below):
; Sript to Manage Hotkeys and Hotstrings ahk file
; Author: Shajul
; 
#SingleInstance force
#NoTrayIcon
;; TO DO

if 0>0
  Hotkeyfile = %1%
else
{
  IfExist,MyHotKeys.ahk
	Hotkeyfile = MyHotKeys.ahk
  else
  {
	  MsgBox, 35, HotManager, No script file specified.`n`nTo select your script file`, click YES`nTo create a new script file`, click NO
	  IfMsgBox, Yes
		{
		FileSelectFile,Hotkeyfile,,%A_ScriptDir%,Kindly select script file to manage..,Autohotkey scripts (*.ahk)
		If Errorlevel
			ExitApp
		}
	  Else IfMsgBox, No
		{
		URLDownloadToFile,https://ahknet.autohotkey.com/~shajul/bin/MyHotKeys.ahk,MyHotKeys.ahk
		If !Errorlevel
			Hotkeyfile = MyHotKeys.ahk
		Else
		  {
			MsgBox, 48, Failed!, Download failed! Please try again later.
			ExitApp
		  }
		}
	  Else
		ExitApp  
  }
}
myObject := Object()
gosub CreateGUI									;Create GUI of main window

GuiControl, -Redraw, MyLV
gosub KeyList
LV_ModifyCol(1, 80)
LV_ModifyCol(2, 200)
LV_ModifyCol(3, 200)
LV_ModifyCol(4, 30)
GuiControl, +Redraw, MyLV

Gui, Font, s8 cNavy Bold, Verdana  ; Setting new font
GuiControl, Font, MList
GuiControl, , MList, %MList%				    ;  populate Hotkeyz list
MList=

Gui, Show, center h400 w780,  Hotkeyz - Shajul
Return

MyHelp:
MsgBox, 64,Hotkeyz v1.2, Hotkeyz Help`n¯¯¯¯¯¯¯¯¯¯¯`nAutoHotkey unleashes the full potential of your keyboard
		, joystick, and mouse. For example, in addition to the typical Control, Alt
		, and Shift modifiers, you can use the Windows key and the Capslock key as modifiers
		. `nIn fact, you can make any key or mouse button act as a modifier.`n`n- Automate almost anything by sending keystrokes and mouse clicks. `n- You can write macros by hand or use the macro recorder.`n- Remap keys and buttons on your keyboard, joystick, and mouse.
return

MyAbout:
MsgBox,64,About Hotkeyz!,Hotkeyz v1.2`n`n`nHotkeys GUI and functionality scripts!              `n`n`n(c) Shajul, 2005`[email protected]
return


;- - - - - - - - - - - - - - - - - - MAIN GUI - - - - - - - - - - - - - - - - - 
CreateGUI:
Gui, Add, ListView, x380 y0 r100 w400 h400 vMyLV gMyLV, Hotkey|Description|Code|ID
Gui, Add, Button, x5 y370 w70 h23 gButtonEdit, &Edit Script
Gui, Add, Button, x75 y370 w70 h23 gGuiClose, &Close
Gui, Add, GroupBox, x2 y25 w375 h340, Add..

;FIRST TAB CONTROL
Gui, Add, Tab2, x2 y2 h20 w160 Buttons vTab1 AltSubmit,Add Hotkey|Add Hotstring

;Add Hotkey
Gui, Add, Text, x10 y274 h19 , Hotkeys:
Gui, Add, Hotkey, x+5 y274 w164 h21 vMyHot, 
Gui, Add, Checkbox, x+5 y276 w100 h20 vWinKy Checked, Add &WIN Key
Gui, Add, Button, x100 y335 w100 h23 gAddHotkey, &Add Hotkey

;Add Hotstring
Gui, Tab, 2
Gui, Add, Text, x10 y274 h19 , Hotstring:
Gui, Add, Edit, x+5 y274 w164 h21 vMyHotstring, 
Gui, Add, Checkbox, x+5 y276 h20 vAutocorrect Checked, &Autocorrect mode
Gui, Add, Button, x100 y335 w100 h23 gAddHotstring, &Add HotString

Gui, Tab	;End of first tab control

;SECOND TAB CONTROL
Gui, Add, Tab2, x170 y2 w200 h20 buttons vTab2 AltSubmit,Application/File|Code/AutoCorrect

;Run file/application
Gui, Add, Text, x10 y40 w190 h17 , Hotkey for file/application:
Gui, Add, Edit, x10 y56 w240 h21 vEdt, 
Gui, Add, Button, x250 y56 w25 h23 , ...

Gui, Add, Text, x10 y90 w160 h19 , Working Directory:
Gui, Add, Edit, x10 y107 w255 h21 vWrk, 
Gui, Add, Checkbox, x147 y90 w122 h16 vUseWrk, Use Work &Directory
Gui, Add, Text, x270 y90 h18 , Start Mode:
Gui, Add, DropDownList, x270 y107 w100 h21 r4 vMdChoice Choose1, |Max|Min|Hide

;Run Code
Gui, Tab, 2
Gui, Add, Text, x10 y40 h17 , Run code/Autocorrect (only for hotstrings):
Gui, Add, Edit, x10 y56 w360 h205 vEdtCode,

Gui, Tab	;End of second tab control

Gui, Add, Text, x10 y305 h18 , Description:
Gui, Add, Edit, x+5 y305 w271 h20 vDesc, 
Gui, Add, Button, x200 y335 w66 h23 , &Reset
; Generated using SmartGUI Creator 4.0

;Menu, Standard, Standard
Menu, MyFile, add, &Edit Script, ButtonEdit
Menu, MyFile, add
Menu, MyFile, add, &Close	Alt+F4, guiclose
Menu, MyHlp, add, Hotkeyz Help, MyHelp
Menu, MyHlp, add, &About, MyAbout
Menu, MyMain, add, &File, :MyFile
;Menu, MyMain, add, &Default, :Standard
Menu, MyMain, add, &Help, :MyHlp
Gui, Menu, MyMain
return


;- - - - - - - - - - - - - - - - - - TAB HOTKEYZ - - - - - - - - - - - - - - - - - - 
Button...:
FileSelectFile, HotFile, 3, C:\Program Files, Select file to assign hotkey, All Files (*.*)
SplitPath,HotFile,,MyODir,,MyDesc,  ;SPLIT PATH, ASSIGN VALUES TO EDIT CONTROLS
GuiControl,, Edt,%HotFile%
GuiControl,, Wrk,%MyODir%
GuiControl,, Desc,%MyDesc%
Return

ButtonEdit:
Run, edit %Hotkeyfile%
Gui, Hide
return

MyLV:
hotstring=
ChHot=
if A_GuiEvent != DoubleClick
	return
myln := A_EventInfo
LV_GetText(MDesc,myln,2)
IfInString, MDesc, -------------------------  ;it is a comment
	return
LV_GetText(CurHot,myln)
LV_GetText(tvar3,myln,3)
LV_GetText(tvar4,myln,4)
Gui, 3:Add, Text, x110 w241 h20 vCurHot, %CurHot%
Gui, 3:Add, Text, x6 y25 w100 h15,Description:
Gui, 3:Add, Edit, vMDesc x+3 y25 w180 h25, %MDesc%
Gui, 3:Add, Edit, vMEdit x6 y56 w365 h150, 
Gui, 3:Add, CheckBox,gChHot x6 y211 h15 w100,Change Hotkey:
if (InStr(tvar3,":")=1) ;it is a hotstring
{
	hotstring=1
	Gui, 3:Add, Text, x6 y5 h15 w100,Current Hotstring:
	Gui, 3:Add, Edit, vMEdHot x180 y211 w180 h25 Disabled
	if (InStr(tvar3,"*")=2)
		StringTrimLeft,tvar3,tvar3,3  ;it is a :*: hotstring
	else
		StringTrimLeft,tvar3,tvar3,2		
}
else
{
	Gui, 3:Add, Text, x6 y5 h15 w100,Current Hotkey:
	Gui, 3:Add, Hotkey, vMEdHot x+3 y211 w180 h25 Disabled
	Gui, 3:Add, CheckBox, vAddWnKy3 x+3 y211 h15 Checked Disabled,Add WIN Key
}
StringReplace, tvar3, tvar3,`:`:,|
StringSplit, tvar, tvar3, |
GuiControl,3:,MEdit,%tvar2%						;tvar1 is hotkey, tvar2 is cmd, 
oldhotk=%tvar1%
Gui, 3:Add, Button, x5 y240 w70 h25 gSaveEdit, &Ok
Gui, 3:Add, Button, x+5 w70 h25 g3GuiClose, &Cancel
Gui, 3:Add, Button, x270 y240 w100 h25 gDeleteItem, &Delete Selected
Gui, 3:Show, Center h270 w377, Edit Hotkey/Hotstring!
return

3GuiClose:
Gui, 3:Destroy
return

SaveEdit:
Gui, 3:Submit, Nohide
Autotrim on
StringSplit, tvar, MEdit, `n					; split at all carraige return
StringReplace,tvar, tvar%tvar0%, %A_Space%,,All		; trim spaces if any
IfInString, tvar, return
   {
	StringReplace,tvar, tvar1, %A_Space%,,All		; trim spaces if any
   	if tvar										; if it contains anything,
		MEdit = `n%MEdit%							; add a carraige return
   }

Gui,1:Default  ;Otherwise listview will fail
if hotstring
{
	If MEdHot
		{
		LV_Modify(myln,"",MEdHot,MDesc,"`:`:" . MEdHot . "`:`:" . MEdit)
		myObject[tvar4,"cmd"] := "`:`:" . MEdHot . "`:`:" . MEdit
		myObject[tvar4,"desc"] := MDesc
		}
	Else
		{
		LV_Modify(myln,"Col2",MDesc,"`:`:" . oldhotk . "`:`:" . MEdit)
		myObject[tvar4,"cmd"] := "`:`:" . oldhotk . "`:`:" . MEdit
		myObject[tvar4,"desc"] := MDesc
		}
}
else
{
	If MEdHot
		{
		If AddWnKy3
		MEdHot=`#%MEdHot%
		StringReplace,NewHot,MEdHot,#,Win- 
		StringReplace,NewHot,NewHot,!,Alt- 
		StringReplace,NewHot,NewHot,^,Ctrl- 
		StringReplace,NewHot,NewHot,+,Shft- 
		LV_Modify(myln,"",NewHot,MDesc,MEdHot . "`:`:" . MEdit)
		myObject[tvar4,"cmd"] := MEdHot . "`:`:" . MEdit
		myObject[tvar4,"desc"] := MDesc
		}
	Else
		{
		LV_Modify(myln,"Col2",MDesc,oldhotk . "`:`:" . MEdit)
		myObject[tvar4,"cmd"] := oldhotk . "`:`:" . MEdit
		myObject[tvar4,"desc"] := MDesc
		}
}
Gui,3:Destroy
m_change_flag=1
gosub SaveAs
return

DeleteItem:
Gui, 3:Submit, Nohide
Autotrim on
Gui,1:Default  ;Otherwise listview will fail
myObject[tvar4,"cmd"] := ""
myObject[tvar4,"desc"] := ""
LV_Delete(myln)
Gui,3:Destroy
m_change_flag=1
gosub SaveAs
return

SaveAs:
Loop,2
{
	tvar := 3 - A_Index
	tvar1 := tvar + 1
	FileMove,%Hotkeyfile%.bak%tvar%,%Hotkeyfile%.bak%tvar1%,1
}
FileMove,%Hotkeyfile%,%Hotkeyfile%.bak1,1 ;Backup

Loop % myObject.MaxIndex()
{
    ODesc := myObject[A_Index,"desc"]
    OCmd := myObject[A_Index,"cmd"]
	if (!OCmd AND !ODesc)
		continue
	if !ODesc
		OData = %OCmd%
	else if !OCmd  ;It is a comment line
		OData=`;`;%ODesc%	
	else
	{
		IfInString, OCmd, `n ;multi-line command block
		{
			Loop,Parse,OCmd,`n
			{
				if A_Index=1
					OData = %A_LoopField%%A_Space%`;%ODesc%`n	;add the description to the first line
				else
					OData .= A_LoopField . "`n" 
			}
		}
		else
			OData = %OCmd%%A_Space%`;%ODesc%
	}
	
	FileAppend,%OData%`n,%Hotkeyfile%
	OData=
}
return

ChHot:
chHot := chHot ? 0:1
GuiControl,3:Enable%chHot%,MEdHot
GuiControl,3:Enable%chHot%,AddWnKy3
GuiControl,,MEdHot,
return


ButtonReset:
GuiControl,, Edt,
GuiControl,, Wrk,
GuiControl,, Desc,
GuiControl,Choose, MdChoice,1
GuiControl,, MyHot,
return

guiclose:
ExitApp
return

AddHotkey:
gui, submit, nohide
if !MyHot  ;CHECK IF HOTKEY IS NOT ASSIGNED
	Gosub Upd
descf := Desc ? ";" . Desc:""  ; IF NO DESCRIPTION, DONT ADD IT
WinKy := WinKy=1 ? "#":""  ; CHECK IF WINDOWS KEY REQUIRED
if Tab2=1
{
	If !Edt
		Gosub Upd
	if UseWrk!=1 ; CHECK IF WORKING DIRECTORY REQUIRED
		Wrk=
	clipd=%WinKy%%MyHot%`:`:Run %Edt%,%Wrk%,%MdChoice%,%A_Space% %descf%
}
else
{
	If !EdtCode
		Gosub Upd
	IfNotInString,EdtCode,return
		EdtCode = %EdtCode%`nreturn
	clipd=%WinKy%%MyHot%`:`:%A_Space% %descf%`n%EdtCode%
}
FileAppend,`n%clipd%, %Hotkeyfile%
gosub ParseCode
Run %Hotkeyfile%
MsgBox,64,HotKeyz, Congratulations, New hotkey added!
return



AddHotstring:
gui, submit, nohide
if !MyHotstring  ;CHECK IF HOTKEY IS NOT ASSIGNED
	Gosub Upd
descf := Desc ? ";" . Desc:""  ; IF NO DESCRIPTION, DONT ADD IT
if Tab2=1
{
	If !Edt
		Gosub Upd
	if UseWrk!=1 ; CHECK IF WORKING DIRECTORY REQUIRED
		Wrk=
	clipd=`:`:%MyHotstring%`:`: %A_Space% %descf%`nRun %Edt%,%Wrk%,%MdChoice%`nreturn
}
else
{
	If !EdtCode
		Gosub Upd
	If !AutoCorrect
	{
		IfNotInString,EdtCode,return
			EdtCode = %EdtCode%`nreturn
		clipd=`:`:%MyHotstring%`:`:%A_Space% %descf%`n%EdtCode%
	}
	else
		clipd=`:`:%MyHotstring%`:`:%EdtCode%%A_Space% %descf%
}
FileAppend,`n%clipd%, %Hotkeyfile%
gosub ParseCode
Run %Hotkeyfile%
MsgBox,64,HotKeyz, Congratulations, New hotstring added!
return

Upd:
  MsgBox,48,Invalid Hotkey/Hotstring/File, No Hotkey/Botstring and/or run command assigned.`n`nAssign a Run Command or browse for a file/program`nPress any combination of CTRL, SHIFT, ALT, KEY to use as hotkey or select a hotstring!
Exit
return



KeyList: 
my_i=1
Loop,Read,%Hotkeyfile%
{
	if getmore
		{
		 StringReplace, tvar, A_LoopReadLine,%A_Tab%,,All
		 if CheckLine(A_LoopReadLine)                      ;i.e., it is not a hotkey/hotstring
		  {
		 Cmd=%Cmd%`n%tvar%
		 continue
		  }
		getmore=
		LV_Add("",Keys,Desc,Cmd,my_i)
		myobject[my_i,"cmd"] := Cmd
		myobject[my_i,"desc"] := Desc
		my_i++
		}
	if getmorejunk
		{
		 StringReplace, tvar, A_LoopReadLine,%A_Tab%,,All
		 if CheckLine(A_LoopReadLine)                      ;i.e., it is not a hotkey/hotstring
		  {
		 Cmd1=%Cmd1%`n%tvar%
		 continue
		  }
		getmorejunk=
		myobject[my_i,"cmd"] := Cmd1
		myobject[my_i,"desc"] := ""
		my_i++
		}	
	Cmd := ParseHotLine(A_LoopReadLine)
	if !Cmd
		{
		getmorejunk=1
		Cmd1:=A_LoopReadLine
		continue
		}
	if Cmd=comment
		{
		LV_Add("",Keys,Desc,Cmd,my_i)
		myobject[my_i,"cmd"] := ""
		myobject[my_i,"desc"] := Desc
		my_i++
		Continue 
		}
	StringSplit RCmd,Cmd,`:,%A_Space%%A_Tab%
	if (RCmd0>2 and RCmd3 != "")
		{
		LV_Add("",Keys,Desc,Cmd,my_i)
		myobject[my_i,"cmd"] := Cmd
		myobject[my_i,"desc"] := Desc
		my_i++
		}
	else
		getmore=1
} 
if getmore
{
	getmore=
	LV_Add("",Keys,Desc,Cmd,my_i)
	myobject[my_i,"cmd"] := Cmd
	myobject[my_i,"desc"] := Desc
	my_i++
}
if getmorejunk
{
	getmorejunk=
	myobject[my_i,"cmd"] := Cmd1
	myobject[my_i,"desc"] := ""
	my_i++
}	
return

ParseCode: 
  Loop,Parse,clipd,`n
  {
	if getmore=1
		{
		 StringReplace, tvar, A_LoopField,%A_Tab%,,All
		 if CheckLine(A_LoopField)                      ;i.e., it is not a hotkey/hotstring
		  {
  		 Cmd=%Cmd%`n%tvar%
  		 continue
		  }
	    getmore=
	    LV_Add("",Keys,Desc,Cmd,my_i)
	    myobject[my_i,"cmd"] := Cmd
		myobject[my_i,"desc"] := Desc
		my_i++
		}
	if getmorejunk=1
		{
		 StringReplace, tvar, A_LoopField,%A_Tab%,,All
		 if CheckLine(A_LoopField)                      ;i.e., it is not a hotkey/hotstring
		  {
  		 Cmd1=%Cmd1%`n%tvar%
  		 continue
		  }
	    getmorejunk=
	    myobject[my_i,"cmd"] := Cmd1
		myobject[my_i,"desc"] := ""
		my_i++
		}	
	Cmd := ParseHotLine(A_LoopField)
	if !Cmd
		{
		getmorejunk=1
		Cmd1:=A_LoopField
		continue
		}
	if Cmd=comment
		{
		LV_Add("",Keys,Desc,Cmd,my_i)
	    myobject[my_i,"cmd"] := ""
		myobject[my_i,"desc"] := Desc
		my_i++
		Continue 
		}
	StringSplit RCmd,Cmd,`:,%A_Space%%A_Tab%
	if (RCmd0>2 and RCmd3 != "")
		{
		LV_Add("",Keys,Desc,Cmd,my_i)
	    myobject[my_i,"cmd"] := Cmd
		myobject[my_i,"desc"] := Desc
		my_i++
		}
	else
		getmore=1
  } 
if getmore
{
	getmore=
	LV_Add("",Keys,Desc,Cmd,my_i)
	myobject[my_i,"cmd"] := Cmd
	myobject[my_i,"desc"] := Desc
	my_i++
}
if getmorejunk
{
	getmorejunk=
	myobject[my_i,"cmd"] := Cmd1
	myobject[my_i,"desc"] := ""
	my_i++
}
return
;- - - - - - - - - - - - - - - - - - COMMON SUBROUTINES - - - - - - - - - - - - - - - - - - 

ParseHotLine(Line)		 ;Function to parse HotKey data file
{
  AutoTrim,off 
  global Keys, Desc
  StringLeft,C2,Line,2 
							; Insert Seperator 
  IfEqual,C2,`;`;
	{ 
	  StringTrimLeft, Desc, Line, 2
	  Desc = %Desc%
    Keys=
	  Desc := "----  " . Desc . "  -------------------------"
	  return "comment"
	}
							; Insert Hotstrings 
  IfEqual,C2,`:`: 
  { 
    StringSplit,Keys,Line,`: 
    Keys=%Keys3%
    StringSplit,Desc,Line,`; 
    StringTrimLeft,Desc,Desc%Desc0%,0
    Line=
  return Desc1
  } 
						; Insert Hotkeys  
  IfInString,Line,`:`: 
  { 
    StringSplit,Keys,Line,`: 
    StringReplace,Keys,Keys1,#,Win- 
    StringReplace,Keys,Keys,!,Alt- 
    StringReplace,Keys,Keys,^,Ctrl- 
    StringReplace,Keys,Keys,+,Shft- 
    StringReplace,Keys,Keys,`;, 
    StringSplit,Desc,Line,`;
    StringTrimLeft,Desc,Desc%Desc0%,0  
    Desc = %Desc%
    Return Desc1
  }
	Else
	{
  	Desc=
  	Keys=
  	return 0
  }
}

CheckLine(Line)		 ;Function to parse HotKey data file
{
  AutoTrim,off 
  If (Instr(line,";;")=1 OR Instr(line,"::"))
	return 0	;Seperator/Hotkey/Hotstring
  Else
    return 1
}

Download:
HotManager | Version by Hoppfrosch here

More Screenshots:
Screenshot - Add your own code

Important:
Backup your main script, before you try out this manager script!
This scripts works for me, if you have any better ideas, constructive critisism please feel free.

iweindesmedt
  • Members
  • 25 posts
  • Last active: Mar 08 2011 09:06 PM
  • Joined: 23 Nov 2010
Very interesting concept. I like it!
Don't teach a pig to sing, it wastes your time and it annoys the pig.

shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006
Thanks for your encouraging comments!

james062
  • Members
  • 75 posts
  • Last active: Jan 08 2016 02:11 PM
  • Joined: 05 Oct 2009
Just what I needed to remember forgotten hot-keys in my main ahk script .
Youre a star :)
All`s well that ends well :-)
I will not appreciate sarcastic or personal insults in reply s to my posts . Those are the acts of cowards being brave from afar .If you cant be productive don't be destructive .

ravigtm
  • Members
  • 5 posts
  • Last active: Jan 24 2011 11:42 AM
  • Joined: 21 Dec 2010
Hi,
this is the script I was looking for but it's giving this error,

Error at line 212

Line Text: myObject[tvar4,"cmd"] :="`:`:" . MEdHot. "`:`:" .MEdit
Error: This line does not contain a recognised action.

The program will exit.



fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007
You need to upgrade to AutoHotkey_L.

Newbie007
  • Members
  • 82 posts
  • Last active: Sep 30 2011 03:12 PM
  • Joined: 01 Dec 2010

You need to upgrade to AutoHotkey_L.


can u tell details? I need smth like that and want to run it but it gives error said above

shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006
steps to get it right-
1. Uninstall autohotkey
2. Kill any running process named "autohotkey.exe"
3. Download autohotkey_l (first option in downloads page.)
4. Choose unicode when asked during installation.
5. Run the script.

crimsonsky
  • Members
  • 7 posts
  • Last active: Feb 03 2015 06:41 PM
  • Joined: 03 Jun 2008
awesome script! just what i was looking for. thanks for sharing!

chrisbull
  • Guests
  • Last active:
  • Joined: --
Hello shajul,

Thanks for a great script.

I am currently managing my hotstrings in a seperate script, say:
\FOLDER\hotstrings.ahk

This file is called in my main script using:
"#Include %A_ScriptDir%\FOLDER\hotstrings.ahk"

I tried playing around, but is there an easy way to modify:
#H::Run %A_AhkPath% HotManager.ahk "%A_ScriptFullPath%", %A_scriptdir%,, hotkeysman    ;HOTKEYS MANAGER

So that it looks in my hotstring file? I appreciate your patience as I'm a bit new at AHK.

Thanks again,
Chris.

hoppfrosch
  • Members
  • 399 posts
  • Last active: Feb 26 2016 05:31 AM
  • Joined: 25 Jan 2006
Hi Shajul,

under certain circumstances (can't specify exactly which..) the resizing of your GUI does not work correctly:
The "Edit Script" and "close" Button can not be seen anymore after resizing, as they are moved beyond the lower border

shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006
@chrisbull:
#H::Run %A_AhkPath% [color=red]C:\Full\Path\Of\[/color]HotManager.ahk "%A_ScriptFullPath%", %A_scriptdir%,, hotkeysman    ;HOTKEYS MANAGER

@hoppfrosch:
i'll look into it
If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor

chrisbull
  • Guests
  • Last active:
  • Joined: --
Hi shajul,

Thanks for the speedy response. Unfortunately that doesn't help as it is only listing the hotkeys in my main script file and not the ones in:
#Include %A_ScriptDir%\FOLDER\hotstrings.ahk

It's no biggie if it's not an easy fix.

I'll just move all my hotstrings to my main script file.

Cheers,
Chris.

shajul nli
  • Guests
  • Last active:
  • Joined: --
yes, it will manage one file only.

hoppfrosch
  • Members
  • 399 posts
  • Last active: Feb 26 2016 05:31 AM
  • Joined: 25 Jan 2006
Just made some (really simple) modifications - to allow resizing of the dialog boxes.

I simply used Majkinetor's Attach module from his great [AHK & AHK_L] Forms Framework 0.8


; Sript to Manage Hotkeys and Hotstrings ahk file
; Author: Shajul
;
#SingleInstance force
#NoTrayIcon
;; TO DO

if 0>0
   Hotkeyfile = %1%
else
{
  IfExist,MyHotKeys.ahk
   Hotkeyfile = MyHotKeys.ahk
  else
  {
     MsgBox, 35, HotManager, No script file specified.`n`nTo select your script file`, click YES`nTo create a new script file`, click NO
     IfMsgBox, Yes
      {
      FileSelectFile,Hotkeyfile,,%A_ScriptDir%,Kindly select script file to manage..,Autohotkey scripts (*.ahk)
      If Errorlevel
         ExitApp
      }
     Else IfMsgBox, No
      {
      URLDownloadToFile,https://ahknet.autohotkey.com/~shajul/bin/MyHotKeys.ahk,MyHotKeys.ahk
      If !Errorlevel
         Hotkeyfile = MyHotKeys.ahk
      Else
        {
         MsgBox, 48, Failed!, Download failed! Please try again later.
         ExitApp
        }
      }
     Else
      ExitApp 
  }
}
myObject := Object()
gosub CreateGUI                           ;Create GUI of main window

GuiControl, -Redraw, MyLV
gosub KeyList
LV_ModifyCol(1, 80)
LV_ModifyCol(2, 200)
LV_ModifyCol(3, 200)
LV_ModifyCol(4, 30)
GuiControl, +Redraw, MyLV

Gui, Font, s8 cNavy Bold, Verdana  ; Setting new font
Gui, +Resize +MinSize
GuiControl, Font, MList
GuiControl, , MList, %MList%                ;  populate Hotkeyz list
MList=

Gui, Show, center h400 w780,  Hotkeyz - Shajul
Return

MyHelp:
MsgBox, 64,Hotkeyz v1.2, Hotkeyz Help`n¯¯¯¯¯¯¯¯¯¯¯`nAutoHotkey unleashes the full potential of your keyboard
      , joystick, and mouse. For example, in addition to the typical Control, Alt
      , and Shift modifiers, you can use the Windows key and the Capslock key as modifiers
      . `nIn fact, you can make any key or mouse button act as a modifier.`n`n- Automate almost anything by sending keystrokes and mouse clicks. `n- You can write macros by hand or use the macro recorder.`n- Remap keys and buttons on your keyboard, joystick, and mouse.
return

MyAbout:
MsgBox,64,About Hotkeyz!,Hotkeyz v1.2`n`n`nHotkeys GUI and functionality scripts!              `n`n`n(c) Shajul, 2005`[email protected]
return


;- - - - - - - - - - - - - - - - - - MAIN GUI - - - - - - - - - - - - - - - - -
CreateGUI:
Gui, Add, ListView, HWNDMyLV x380 y0 r100 w400 h400 vMyLV gMyLV, Hotkey|Description|Code|ID
Gui, Add, Button, HWNDMyEditScript x5 y370 w70 h23 gButtonEdit, &Edit Script
Gui, Add, Button, HWNDMyClose x75 y370 w70 h23 gGuiClose, &Close
Gui, Add, GroupBox, HWNDMyAdd x2 y25 w375 h340, Add..

;FIRST TAB CONTROL
Gui, Add, Tab2, x2 y2 h20 w160 Buttons vTab1 AltSubmit,Add Hotkey|Add Hotstring

;Add Hotkey
Gui, Add, Text, HWNDMyHotkeys x10 y274 h19 , Hotkeys:
Gui, Add, Hotkey, HWNDMyHotkeysEdit x+5 y274 w164 h21 vMyHot,
Gui, Add, Checkbox, HWNDMyAddWinKey x+5 y276 w100 h20 vWinKy Checked, Add &WIN Key
Gui, Add, Button, HWNDMyAddHotkey x100 y335 w100 h23 gAddHotkey, &Add Hotkey

;Add Hotstring
Gui, Tab, 2
Gui, Add, Text, HWNDMyHotstring x10 y274 h19 , Hotstring:
Gui, Add, Edit, HWNDMyHotstringEdit x+5 y274 w164 h21 vMyHotstring,
Gui, Add, Checkbox, HWNDMyAutocorrectmode x+5 y276 h20 vAutocorrect Checked, &Autocorrect mode
Gui, Add, Button, HWNDMyAddHotstring x100 y335 w100 h23 gAddHotstring, &Add HotString

Gui, Tab   ;End of first tab control

;SECOND TAB CONTROL
Gui, Add, Tab2, x170 y2 w200 h20 buttons vTab2 AltSubmit,Application/File|Code/AutoCorrect

;Run file/application
Gui, Add, Text, x10 y40 w190 h17 , Hotkey for file/application:
Gui, Add, Edit, x10 y56 w240 h21 vEdt,
Gui, Add, Button, x250 y56 w25 h23 , ...

Gui, Add, Text, x10 y90 w160 h19 , Working Directory:
Gui, Add, Edit, x10 y107 w255 h21 vWrk,
Gui, Add, Checkbox, x147 y90 w122 h16 vUseWrk, Use Work &Directory
Gui, Add, Text, x270 y90 h18 , Start Mode:
Gui, Add, DropDownList, x270 y107 w100 h21 r4 vMdChoice Choose1, |Max|Min|Hide

;Run Code
Gui, Tab, 2
Gui, Add, Text, x10 y40 h17 , Run code/Autocorrect (only for hotstrings):
Gui, Add, Edit, HWNDMyRunCodeEdit x10 y56 w360 h205 vEdtCode,

Gui, Tab   ;End of second tab control

Gui, Add, Text, HWNDMyDescription x10 y305 h18 , Description:
Gui, Add, Edit, HWNDMyDescriptionEdit x+5 y305 w271 h20 vDesc,
Gui, Add, Button, HWNDMyReset x200 y335 w66 h23 , &Reset
; Generated using SmartGUI Creator 4.0

gosub SetAttach

;Menu, Standard, Standard
Menu, MyFile, add, &Edit Script, ButtonEdit
Menu, MyFile, add
Menu, MyFile, add, &Close   Alt+F4, guiclose
Menu, MyHlp, add, Hotkeyz Help, MyHelp
Menu, MyHlp, add, &About, MyAbout
Menu, MyMain, add, &File, :MyFile
;Menu, MyMain, add, &Default, :Standard
Menu, MyMain, add, &Help, :MyHlp
Gui, Menu, MyMain
return


;- - - - - - - - - - - - - - - - - - TAB HOTKEYZ - - - - - - - - - - - - - - - - - -
Button...:
FileSelectFile, HotFile, 3, C:\Program Files, Select file to assign hotkey, All Files (*.*)
SplitPath,HotFile,,MyODir,,MyDesc,  ;SPLIT PATH, ASSIGN VALUES TO EDIT CONTROLS
GuiControl,, Edt,%HotFile%
GuiControl,, Wrk,%MyODir%
GuiControl,, Desc,%MyDesc%
Return

ButtonEdit:
Run, edit %Hotkeyfile%
Gui, Hide
return

MyLV:
hotstring=
ChHot=
if A_GuiEvent != DoubleClick
   return
myln := A_EventInfo
LV_GetText(MDesc,myln,2)
IfInString, MDesc, -------------------------  ;it is a comment
   return
LV_GetText(CurHot,myln)
LV_GetText(tvar3,myln,3)
LV_GetText(tvar4,myln,4)
Gui, 3:Add, Text, x110 w241 h20 vCurHot, %CurHot%
Gui, 3:Add, Text, x6 y25 w100 h15,Description:
Gui, 3:Add, Edit, HWNDMy3DescriptionEdit vMDesc x+3 y25 w260 h25, %MDesc%
Gui, 3:Add, Edit, HWNDMy3CodeEdit vMEdit x6 y56 w365 h150,
if (InStr(tvar3,":")=1) ;it is a hotstring
{
   hotstring=1
   Gui, 3:Add, Text, x6 y5 h15 w100,Current Hotstring:
   Gui, 3:Add, CheckBox, HWNDMy3ChangeHotkey gChHot x6 y211 h15 w110,Change Hotstring:
   Gui, 3:Add, Edit, HWNDMy3HotkeyEdit vMEdHot x180 y211 w180 h25 Disabled
   Gui, 3:Add, Text, HWNDMy3AddWinKey vAddWnKy3 x+3 y211 h1 ; Just to have the HANDLE - for symmetry (needed for used to be within attach)
   if (InStr(tvar3,"*")=2)
      StringTrimLeft,tvar3,tvar3,3  ;it is a :*: hotstring
   else
      StringTrimLeft,tvar3,tvar3,2      
}
else
{
   Gui, 3:Add, Text, x6 y5 h15 w100,Current Hotkey:
   Gui, 3:Add, CheckBox, HWNDMy3ChangeHotkey gChHot x6 y211 h15 w110,Change Hotkey:
   Gui, 3:Add, Hotkey, HWNDMy3HotkeyEdit vMEdHot x+3 y211 w180 h25 Disabled
   Gui, 3:Add, CheckBox, HWNDMy3AddWinKey vAddWnKy3 x+3 y211 h15 Checked Disabled,Add WIN Key
}
StringReplace, tvar3, tvar3,`:`:,|
StringSplit, tvar, tvar3, |
GuiControl,3:,MEdit,%tvar2%                  ;tvar1 is hotkey, tvar2 is cmd,
oldhotk=%tvar1%
Gui, 3:Add, Button, HWNDMy3Ok x5 y240 w70 h25 gSaveEdit, &Ok
Gui, 3:Add, Button, HWNDMy3Cancel x+5 w70 h25 g3GuiClose, &Cancel
Gui, 3:Add, Button, HWNDMy3Delete x270 y240 w100 h25 gDeleteItem, &Delete Selected

Gui, 3:+Resize +MinSize
gosub SetAttach3

Gui, 3:Show, Center h270 w377, Edit Hotkey/Hotstring!
return

3GuiClose:
Gui, 3:Destroy
return

SaveEdit:
Gui, 3:Submit, Nohide
Autotrim on
StringSplit, tvar, MEdit, `n               ; split at all carraige return
StringReplace,tvar, tvar%tvar0%, %A_Space%,,All      ; trim spaces if any
IfInString, tvar, return
   {
   StringReplace,tvar, tvar1, %A_Space%,,All      ; trim spaces if any
      if tvar                              ; if it contains anything,
      MEdit = `n%MEdit%                     ; add a carraige return
   }

Gui,1:Default  ;Otherwise listview will fail
if hotstring
{
   If MEdHot
      {
      LV_Modify(myln,"",MEdHot,MDesc,"`:`:" . MEdHot . "`:`:" . MEdit)
      myObject[tvar4,"cmd"] := "`:`:" . MEdHot . "`:`:" . MEdit
      myObject[tvar4,"desc"] := MDesc
      }
   Else
      {
      LV_Modify(myln,"Col2",MDesc,"`:`:" . oldhotk . "`:`:" . MEdit)
      myObject[tvar4,"cmd"] := "`:`:" . oldhotk . "`:`:" . MEdit
      myObject[tvar4,"desc"] := MDesc
      }
}
else
{
   If MEdHot
      {
      If AddWnKy3
      MEdHot=`#%MEdHot%
      StringReplace,NewHot,MEdHot,#,Win-
      StringReplace,NewHot,NewHot,!,Alt-
      StringReplace,NewHot,NewHot,^,Ctrl-
      StringReplace,NewHot,NewHot,+,Shft-
      LV_Modify(myln,"",NewHot,MDesc,MEdHot . "`:`:" . MEdit)
      myObject[tvar4,"cmd"] := MEdHot . "`:`:" . MEdit
      myObject[tvar4,"desc"] := MDesc
      }
   Else
      {
      LV_Modify(myln,"Col2",MDesc,oldhotk . "`:`:" . MEdit)
      myObject[tvar4,"cmd"] := oldhotk . "`:`:" . MEdit
      myObject[tvar4,"desc"] := MDesc
      }
}
Gui,3:Destroy
m_change_flag=1
gosub SaveAs
return

DeleteItem:
Gui, 3:Submit, Nohide
Autotrim on
Gui,1:Default  ;Otherwise listview will fail
myObject[tvar4,"cmd"] := ""
myObject[tvar4,"desc"] := ""
LV_Delete(myln)
Gui,3:Destroy
m_change_flag=1
gosub SaveAs
return

SaveAs:
Loop,2
{
   tvar := 3 - A_Index
   tvar1 := tvar + 1
   FileMove,%Hotkeyfile%.bak%tvar%,%Hotkeyfile%.bak%tvar1%,1
}
FileMove,%Hotkeyfile%,%Hotkeyfile%.bak1,1 ;Backup

Loop % myObject.MaxIndex()
{
    ODesc := myObject[A_Index,"desc"]
    OCmd := myObject[A_Index,"cmd"]
   if (!OCmd AND !ODesc)
      continue
   if !ODesc
      OData = %OCmd%
   else if !OCmd  ;It is a comment line
      OData=`;`;%ODesc%   
   else
   {
      IfInString, OCmd, `n ;multi-line command block
      {
         Loop,Parse,OCmd,`n
         {
            if A_Index=1
               OData = %A_LoopField%%A_Space%`;%ODesc%`n   ;add the description to the first line
            else
               OData .= A_LoopField . "`n"
         }
      }
      else
         OData = %OCmd%%A_Space%`;%ODesc%
   }
   
   FileAppend,%OData%`n,%Hotkeyfile%
   OData=
}
return

ChHot:
chHot := chHot ? 0:1
GuiControl,3:Enable%chHot%,MEdHot
GuiControl,3:Enable%chHot%,AddWnKy3
GuiControl,,MEdHot,
return


ButtonReset:
GuiControl,, Edt,
GuiControl,, Wrk,
GuiControl,, Desc,
GuiControl,Choose, MdChoice,1
GuiControl,, MyHot,
return

guiclose:
ExitApp
return

AddHotkey:
gui, submit, nohide
if !MyHot  ;CHECK IF HOTKEY IS NOT ASSIGNED
   Gosub Upd
descf := Desc ? ";" . Desc:""  ; IF NO DESCRIPTION, DONT ADD IT
WinKy := WinKy=1 ? "#":""  ; CHECK IF WINDOWS KEY REQUIRED
if Tab2=1
{
   If !Edt
      Gosub Upd
   if UseWrk!=1 ; CHECK IF WORKING DIRECTORY REQUIRED
      Wrk=
   clipd=%WinKy%%MyHot%`:`:Run %Edt%,%Wrk%,%MdChoice%,%A_Space% %descf%
}
else
{
   If !EdtCode
      Gosub Upd
   IfNotInString,EdtCode,return
      EdtCode = %EdtCode%`nreturn
   clipd=%WinKy%%MyHot%`:`:%A_Space% %descf%`n%EdtCode%
}
FileAppend,`n%clipd%, %Hotkeyfile%
gosub ParseCode
Run %Hotkeyfile%
MsgBox,64,HotKeyz, Congratulations, New hotkey added!
return



AddHotstring:
gui, submit, nohide
if !MyHotstring  ;CHECK IF HOTKEY IS NOT ASSIGNED
   Gosub Upd
descf := Desc ? ";" . Desc:""  ; IF NO DESCRIPTION, DONT ADD IT
if Tab2=1
{
   If !Edt
      Gosub Upd
   if UseWrk!=1 ; CHECK IF WORKING DIRECTORY REQUIRED
      Wrk=
   clipd=`:`:%MyHotstring%`:`: %A_Space% %descf%`nRun %Edt%,%Wrk%,%MdChoice%`nreturn
}
else
{
   If !EdtCode
      Gosub Upd
   If !AutoCorrect
   {
      IfNotInString,EdtCode,return
         EdtCode = %EdtCode%`nreturn
      clipd=`:`:%MyHotstring%`:`:%A_Space% %descf%`n%EdtCode%
   }
   else
      clipd=`:`:%MyHotstring%`:`:%EdtCode%%A_Space% %descf%
}
FileAppend,`n%clipd%, %Hotkeyfile%
gosub ParseCode
Run %Hotkeyfile%
MsgBox,64,HotKeyz, Congratulations, New hotstring added!
return

Upd:
  MsgBox,48,Invalid Hotkey/Hotstring/File, No Hotkey/Botstring and/or run command assigned.`n`nAssign a Run Command or browse for a file/program`nPress any combination of CTRL, SHIFT, ALT, KEY to use as hotkey or select a hotstring!
Exit
return



KeyList:
my_i=1
Loop,Read,%Hotkeyfile%
{
   if getmore
      {
       StringReplace, tvar, A_LoopReadLine,%A_Tab%,,All
       if CheckLine(A_LoopReadLine)                      ;i.e., it is not a hotkey/hotstring
        {
       Cmd=%Cmd%`n%tvar%
       continue
        }
      getmore=
      LV_Add("",Keys,Desc,Cmd,my_i)
      myobject[my_i,"cmd"] := Cmd
      myobject[my_i,"desc"] := Desc
      my_i++
      }
   if getmorejunk
      {
       StringReplace, tvar, A_LoopReadLine,%A_Tab%,,All
       if CheckLine(A_LoopReadLine)                      ;i.e., it is not a hotkey/hotstring
        {
       Cmd1=%Cmd1%`n%tvar%
       continue
        }
      getmorejunk=
      myobject[my_i,"cmd"] := Cmd1
      myobject[my_i,"desc"] := ""
      my_i++
      }   
   Cmd := ParseHotLine(A_LoopReadLine)
   if !Cmd
      {
      getmorejunk=1
      Cmd1:=A_LoopReadLine
      continue
      }
   if Cmd=comment
      {
      LV_Add("",Keys,Desc,Cmd,my_i)
      myobject[my_i,"cmd"] := ""
      myobject[my_i,"desc"] := Desc
      my_i++
      Continue
      }
   StringSplit RCmd,Cmd,`:,%A_Space%%A_Tab%
   if (RCmd0>2 and RCmd3 != "")
      {
      LV_Add("",Keys,Desc,Cmd,my_i)
      myobject[my_i,"cmd"] := Cmd
      myobject[my_i,"desc"] := Desc
      my_i++
      }
   else
      getmore=1
}
if getmore
{
   getmore=
   LV_Add("",Keys,Desc,Cmd,my_i)
   myobject[my_i,"cmd"] := Cmd
   myobject[my_i,"desc"] := Desc
   my_i++
}
if getmorejunk
{
   getmorejunk=
   myobject[my_i,"cmd"] := Cmd1
   myobject[my_i,"desc"] := ""
   my_i++
}   
return

ParseCode:
  Loop,Parse,clipd,`n
  {
   if getmore=1
      {
       StringReplace, tvar, A_LoopField,%A_Tab%,,All
       if CheckLine(A_LoopField)                      ;i.e., it is not a hotkey/hotstring
        {
         Cmd=%Cmd%`n%tvar%
         continue
        }
       getmore=
       LV_Add("",Keys,Desc,Cmd,my_i)
       myobject[my_i,"cmd"] := Cmd
      myobject[my_i,"desc"] := Desc
      my_i++
      }
   if getmorejunk=1
      {
       StringReplace, tvar, A_LoopField,%A_Tab%,,All
       if CheckLine(A_LoopField)                      ;i.e., it is not a hotkey/hotstring
        {
         Cmd1=%Cmd1%`n%tvar%
         continue
        }
       getmorejunk=
       myobject[my_i,"cmd"] := Cmd1
      myobject[my_i,"desc"] := ""
      my_i++
      }   
   Cmd := ParseHotLine(A_LoopField)
   if !Cmd
      {
      getmorejunk=1
      Cmd1:=A_LoopField
      continue
      }
   if Cmd=comment
      {
      LV_Add("",Keys,Desc,Cmd,my_i)
       myobject[my_i,"cmd"] := ""
      myobject[my_i,"desc"] := Desc
      my_i++
      Continue
      }
   StringSplit RCmd,Cmd,`:,%A_Space%%A_Tab%
   if (RCmd0>2 and RCmd3 != "")
      {
      LV_Add("",Keys,Desc,Cmd,my_i)
       myobject[my_i,"cmd"] := Cmd
      myobject[my_i,"desc"] := Desc
      my_i++
      }
   else
      getmore=1
  }
if getmore
{
   getmore=
   LV_Add("",Keys,Desc,Cmd,my_i)
   myobject[my_i,"cmd"] := Cmd
   myobject[my_i,"desc"] := Desc
   my_i++
}
if getmorejunk
{
   getmorejunk=
   myobject[my_i,"cmd"] := Cmd1
   myobject[my_i,"desc"] := ""
   my_i++
}
return
;- - - - - - - - - - - - - - - - - - COMMON SUBROUTINES - - - - - - - - - - - - - - - - - -

ParseHotLine(Line)       ;Function to parse HotKey data file
{
  AutoTrim,off
  global Keys, Desc
  StringLeft,C2,Line,2
                     ; Insert Seperator
  IfEqual,C2,`;`;
   {
     StringTrimLeft, Desc, Line, 2
     Desc = %Desc%
    Keys=
     Desc := "----  " . Desc . "  -------------------------"
     return "comment"
   }
                     ; Insert Hotstrings
  IfEqual,C2,`:`:
  {
    StringSplit,Keys,Line,`:
    Keys=%Keys3%
    StringSplit,Desc,Line,`;
    StringTrimLeft,Desc,Desc%Desc0%,0
    Line=
  return Desc1
  }
                  ; Insert Hotkeys 
  IfInString,Line,`:`:
  {
    StringSplit,Keys,Line,`:
    StringReplace,Keys,Keys1,#,Win-
    StringReplace,Keys,Keys,!,Alt-
    StringReplace,Keys,Keys,^,Ctrl-
    StringReplace,Keys,Keys,+,Shft-
    StringReplace,Keys,Keys,`;,
    StringSplit,Desc,Line,`;
    StringTrimLeft,Desc,Desc%Desc0%,0 
    Desc = %Desc%
    Return Desc1
  }
   Else
   {
     Desc=
     Keys=
     return 0
  }
}

CheckLine(Line)       ;Function to parse HotKey data file
{
  AutoTrim,off
  If (Instr(line,";;")=1 OR Instr(line,"::"))
   return 0   ;Seperator/Hotkey/Hotstring
  Else
    return 1
}

SetAttach:
    Attach(MyLV,		 "w h")
    Attach(MyEditScript, "y")
    Attach(MyClose,      "y")
    Attach(MyAdd,        "h")
    
    Attach(MyDescription,        "y")
    Attach(MyDescriptionEdit,    "y")
    Attach(MyReset,              "y")
    
    ;Add Hotkey
    Attach(MyHotkeys,            "y")
    Attach(MyHotkeysEdit,        "y")
    Attach(MyAddWinKey,          "y")
    Attach(MyAddHotkey,          "y")

    ;Add Hotstring
    Attach(MyHotstring,       "y")
    Attach(MyHotstringEdit,   "y")
    Attach(MyAutocorrectmode, "y")
    Attach(MyAddHotstring,    "y")
    
    Attach(MyRunCodeEdit,        "h")
Return

SetAttach3:
    Attach(My3DescriptionEdit,    "w")
    Attach(My3CodeEdit,           "w h")
    Attach(My3Ok,                 "y")
    Attach(My3Cancel,             "y")
    Attach(My3Delete,             "x y")
    
    Attach(My3ChangeHotkey,       "y")
    Attach(My3AddWinKey,          "x y")
    Attach(My3HotkeyEdit,         "y w")
    
Return

#include Attach.ahk


[*:a4gp031o] Edit 1: Bugfix on Resize with "Edit Hotstring" Dialogbox[*:a4gp031o] Edit 2: Bugfix on Resize with "Main" Dialogbox on "Add Hotstring" Tab

_________________________
;     (.)~(.)   
;    (-------)                                    
;---ooO-----Ooo---------------------------------------------------
;    Hoppfrosch  - AHK 1.1.04.01 Unicode 32bit on Win7 Ultimate
;-----------------------------------------------------------------                        
;    ( )   ( )                            
;    /|\   /|\