Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;[Menu options]
- Menu = Options:`n1 - [Run/Reload] `n2 - Stop`n3 - Edit`n4 - Save`n5 - Compile|Options:`n1 - Run/Reload `n2 - [Stop]`n3 - Edit`n4 - Save`n5 - Compile|Options:`n1 - Run/Reload `n2 - Stop`n3 - [Edit]`n4 - Save`n5 - Compile|Options:`n1 - Run/Reload `n2 - Stop`n3 - Edit`n4 - [Save]`n5 - Compile|Options:`n1 - Run/Reload `n2 - Stop`n3 - Edit`n4 - Save`n5 - [Compile]
- MenuOptions = Run/Reload|Stop|Edit|Save|Compile
- StringSplit, Menu, Menu, |
- StringSplit, MenuOptions, MenuOptions, |
- RegRead, AutoHotkeyDir, HKEY_LOCAL_MACHINE, SOFTWARE\AutoHotkey, InstallDir
- ;[Assigning keyboard hotkeys]
- Loop, 4
- Hotkey, % Chr(A_Index+48), KeyDown
- ;[/Assigning keyboard hotkeys]
- Return
- ::execute::
- ^R::
- ClipboardOld := Clipboard
- Send ^c
- Script := Clipboard
- Clipboard := ClipboardOld
- ToolTip, %Menu1%
- Return
- KeyDown:
- StringRight, KeyPressed, A_ThisHotKey, 1
- ToolTip, % Menu%KeyPressed%
- Return
- Enter::
- ToolTip, % "Option " MenuOptions%KeyPressed% " is selected"
- Goto, % MenuOptions%KeyPressed%
- Return
- Run/Reload:
- FileDelete, AutoHotkeyTempScript.ahk
- FileAppend, %Script%, %A_Temp%AutoHotkeyTempScript.ahk
- Process, Exist, AutoHotkey.exe
- If (ErrorLevel <> 0){
- TrayTip, Reloading...,, 1, 1
- Process, Close, AutoHotkey.exe
- Run, %A_Temp%AutoHotkeyTempScript.ahk
- }
- Else {
- TrayTip, Executing...,, 1, 1
- Run, %A_Temp%AutoHotkeyTempScript.ahk
- }
- Return
- Stop:
- Process, Exist, AutoHotkey.exe
- If (ErrorLevel <> 0){
- TrayTip, Stopping...,, 1, 1
- Process, Close, AutoHotkey.exe
- }
- Else
- TrayTip, Script already stopped...,, 1, 1
- Return
- Edit:
- Run, notepad.exe, %A_Temp%AutoHotkeyTempScript.ahk
- Return
- Save:
- FileSelectFolder, Folder, *%A_MyDocuments%, 4, Please select a directory to save script
- IfExist, %Folder%\Script.ahk
- {
- MsgBox, 36, Overwrite File?, '%Folder%\Script.ahk' already exists`, overwrite file?
- IfMsgBox, No
- Return
- Else
- FileDelete, %Folder%\Script.ahk
- }
- FileAppend, %Folder%\Script.ahk
- Return
- Compile:
- MsgBox, sorry i haven't wrote this aprt yet`, there is two options`, either make a gui yourself or use a compiler made by rajat i think
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement