AutoHotkey: Start Notepad In Lister: Difference between revisions

From TotalcmdWiki
Jump to navigation Jump to search
(Optimized AHK syntax)
mNo edit summary
Line 1: Line 1:
Pressing F4 in TC Lister starts Notepad with the active document.
Pressing F4 in TC Lister starts Notepad with the active document.
If you want to start an alternative utility instead, replace '''''notepad.exe''''' with the appropriate path.
 
If you prefer an alternative utility, replace '''''notepad.exe''''' with the appropriate path.
   
   
  #IfWinActive, ahk_class TLister
  #IfWinActive, ahk_class TLister
  F4::
  F4::
editor = notepad.exe
  WinGetTitle, title
  WinGetTitle, title
  left := InStr(title, "[") + 1
  left := InStr(title, "[") + 1
Line 9: Line 11:
  StringMid, listerpath, title, left, right
  StringMid, listerpath, title, left, right
  WinClose, ahk_class TLister
  WinClose, ahk_class TLister
  Run, notepad.exe "%listerpath%"
  Run, %editor% "%listerpath%"
  Return
  Return



Revision as of 13:13, 1 June 2006

Pressing F4 in TC Lister starts Notepad with the active document.

If you prefer an alternative utility, replace notepad.exe with the appropriate path.

#IfWinActive, ahk_class TLister
F4::
editor = notepad.exe
WinGetTitle, title
left := InStr(title, "[") + 1
right := InStr(title, "]") - left
StringMid, listerpath, title, left, right
WinClose, ahk_class TLister
Run, %editor% "%listerpath%"
Return


Back to AutoHotkey