;Edit.AHK ;Edit contents of text boxes in favorite editor ;2/21/05 - savage ;put the path to your editor here, you may need to add some parameters if your editor needs any editor = C:\command\vim\vim63\gvim.exe ;path to place the temp file - you'll probably want to change this path = C:\temp.txt ;win-alt-e ;Selects all text, saves to temp file, runs editor on file, waits to exit, paste #!E:: SetKeyDelay, 1 WinGetActiveTitle, wtitle temp = %clipboard% Send, ^a Send, ^c ;if the clipboard didn't change then the box was empty If clipboard = %temp% clipboard = ;In case it wasn't properly deleted FileDelete, %path% FileAppend, %clipboard%, %path% ;refill the clipboard so you can paste things in the editor clipboard = %temp% RunWait, %editor% "%path%" ;and save the clipboard again in case you copied anything in the editor temp = clipboard FileRead, clipboard, %path% FileDelete, %path% WinActivate, %wtitle% WinWaitActive, %wtitle% Send, ^a Send, ^v clipboard = %temp% return
The one problem is that the editor window keeps coming up behind the window that you were in. Any suggestions on how to fix this?