small footprint 'text editor' program with command line ?
small footprint 'text editor' program with command line ?
Hello & Thanks ,
Windows 10
I haven't figured out how to do this in Notepad ,
FIND and FINDSTR don't work for this , so :
Is there a small footprint 'text editor' program
that can be called from another program
passing to it a FIND 'text string'
so that it opens the *.txt file at that line ?
Thanks
Windows 10
I haven't figured out how to do this in Notepad ,
FIND and FINDSTR don't work for this , so :
Is there a small footprint 'text editor' program
that can be called from another program
passing to it a FIND 'text string'
so that it opens the *.txt file at that line ?
Thanks
Re: small footprint 'text editor' program with command line ?
I am updating my app here:
clipLog/clipFind - The Portable Freeware Collection
And want to make it into a FULL Pim .
If I can't find an adequate 'text editor'
I'll have to write it myself .
Ugh!
clipLog/clipFind - The Portable Freeware Collection
And want to make it into a FULL Pim .
If I can't find an adequate 'text editor'
I'll have to write it myself .
Ugh!
Re: small footprint 'text editor' program with command line ?
If going that way, there are plenty of dead FOSS projects you could probably fork...
Re: small footprint 'text editor' program with command line ?
Forgive me if I'm misunderstanding what you're looking for, but I often use AutoHotkey to supplement features I don't find in other programs. Wouldn't a small AutoHotkey program, working on Notepad or any text editor, do this just fine?
Seems there may be two ways to go about this. First, would be to start the text editor (notepad) and emulate the exact keystrokes you would normally use (like a macro). Second, would be to use AutoHotkey to search the text file, find the line number, then use a text editor that can open the text file to that line (like TED Notepad) .
Seems there may be two ways to go about this. First, would be to start the text editor (notepad) and emulate the exact keystrokes you would normally use (like a macro). Second, would be to use AutoHotkey to search the text file, find the line number, then use a text editor that can open the text file to that line (like TED Notepad) .
Re: small footprint 'text editor' program with command line ?
appuser :
Anyways , I get real close with this code in PureBasic :
It works fine until
Delay(1000) : SendKeys(0,w$,"{CONTROLDOWN}v{CONTROLUP}") ; Paste.
BUT it can't Paste into FIND box .
It always pastes into the text area .
Anyone know how to gain Focus and entry to the FIND box ?
I tried all kinds of combinations , but no go .
I was so close , but no-cigar
Thanks
Anyways , I get real close with this code in PureBasic :
Code: Select all
RunProgram("c:notepad.exe","","",0)
w$="Untitled - Notepad" ; Specifies target window name.
Delay(1000) : SendKeys(0,w$,"This is a test!") ; Type some dummy text.
Delay(1000) : SendKeys(0,w$,"{CONTROLDOWN}a{CONTROLUP}") ; Select it all.
Delay(1000) : SendKeys(0,w$,"{CONTROLDOWN}c{CONTROLUP}") ; Copy.
Delay(1000) : SendKeys(0,w$,"{CONTROLDOWN}f{CONTROLUP}") ; Find.
Delay(1000) : SendKeys(0,w$,"{CONTROLDOWN}v{CONTROLUP}") ; Paste.
Delay(1000) : SendKeys(0,w$,"{CONTROLDOWN}v{CONTROLUP}") ; Paste.
BUT it can't Paste into FIND box .
It always pastes into the text area .
Anyone know how to gain Focus and entry to the FIND box ?
I tried all kinds of combinations , but no go .
I was so close , but no-cigar
Thanks
Re: small footprint 'text editor' program with command line ?
This worked for me in AutoHotKey:
After compiling the script into an executable file, you get something like this:
AHKFind.exe %SearchString% %FilePath%
or, for example,
AHKFind "This is a test" %UserProfile%\Documents\test.txt
Code: Select all
SearchString = %1%
FilePath = %2%
SplitPath, FileName, OutFileName
Run, %windir%\system32\notepad.exe %FilePath%
WinActivate, "%FileName% - Notepad"
ControlFocus, "%FileName% - Notepad"
Sleep, 300
Send ^{f}
Send %SearchString%
Send {Enter}
Send {Alt down}{F4}{Alt up}
AHKFind.exe %SearchString% %FilePath%
or, for example,
AHKFind "This is a test" %UserProfile%\Documents\test.txt
Re: small footprint 'text editor' program with command line ?
Hmm...
Plz , how large is the program + Autokey overhead ?
Thanks
Plz , how large is the program + Autokey overhead ?
Thanks
Re: small footprint 'text editor' program with command line ?
You don't need AutoHotKey after the script is compiled. The final binary executable is about 800KB.
Re: small footprint 'text editor' program with command line ?
Well that sounds reasonable .
I will check it out .
Thanks
I will check it out .
Thanks
Re: small footprint 'text editor' program with command line ?
Hmm...
Just needed to issue a sendkey to the "Find" window .
Works great , and compiles to 12kb .
Thanks
Just needed to issue a sendkey to the "Find" window .
Works great , and compiles to 12kb .
Thanks
Code: Select all
RunProgram("notepad.exe","","",0)
w$="Untitled - Notepad" ; Specifies target window name.
Delay(1000) : SendKeys(0,w$,"This is a test!") ; Type some dummy text.
Delay(1000) : SendKeys(0,w$,"{CONTROLDOWN}a{CONTROLUP}") ; Select it all.
Delay(1000) : SendKeys(0,w$,"{CONTROLDOWN}c{CONTROLUP}") ; Copy.
Delay(1000) : SendKeys(0,w$,"{CONTROLDOWN}f{CONTROLUP}") ; Find.
Delay(1000) : SendKeys(0,"Find","{CONTROLDOWN}v{CONTROLUP}") ; Paste.
w$="Untitled - Notepad" ; Specifies target window name.
;Delay(1000) : SendKeys(0,w$,"{DELETE}") ; Delete it.
;Delay(1000) : SendKeys(0,w$,"{CONTROLDOWN}p{CONTROLUP}")
Delay(1000) : SendKeys(0,w$,"This is a second test!") ; Type some dummy text.
;Delay(1000) : SendKeys(0,w$,"{ALTDOWN}{F4}") ; Close the Notepad Window