Control from external program?
Moderators: Hacker, petermad, Stefan2, white
Out of couriosity still the question: What will happen next to the file you now have selected in TC? Will you launch it via Buttonbar to another App? Do you want to copy it somewhere? Split the file?HenrikHusted wrote:It looks like the best solution for me is to use the "/o" parameter to get to the correct directory and then cm_showquickSearch to find the file.
Thanks to all for the quick replies.
sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
2Ergo
As I said, there no big reason to switch to AHK from PP. PP is a magnificent tool for those who are used to it. I am not, I used it for some months, but didnt like it due to the compromises i had to suffer. What I mean by that: yes PP offers StickyNotes, but ATNotes is way better. Yes it offers clipboard history, but CLCL is way better. Yes it offers scripts, but AHK is way better. Yes it offers hotkeys, toolbars etc, but AHK, etc is way better. So just the advantage that i have all these functionalities in one program did not justify PP for me, i have plenty of memory in my PC
Conclusion: if you like PP, stick to it, but in the meanwhile check out the features of AHK, at first it will seem to be much more narrow than PP, but after you discover the strength of it, you will be amazed.
As I said, there no big reason to switch to AHK from PP. PP is a magnificent tool for those who are used to it. I am not, I used it for some months, but didnt like it due to the compromises i had to suffer. What I mean by that: yes PP offers StickyNotes, but ATNotes is way better. Yes it offers clipboard history, but CLCL is way better. Yes it offers scripts, but AHK is way better. Yes it offers hotkeys, toolbars etc, but AHK, etc is way better. So just the advantage that i have all these functionalities in one program did not justify PP for me, i have plenty of memory in my PC

Conclusion: if you like PP, stick to it, but in the meanwhile check out the features of AHK, at first it will seem to be much more narrow than PP, but after you discover the strength of it, you will be amazed.
I switched to Linux, bye and thanks for all the fish!
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
Defenitely not!SanskritFritz wrote:no answer came. Probably not our business.

But anyway a gnawing sting of curiosity. So I started this last attempt.
sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
-
- Junior Member
- Posts: 39
- Joined: 2003-03-24, 10:47 UTC
It's not really a secret why I'm doing this. I have a large database containing filenames and their path, I would like to select one of those files and have tcmd jump that that file.
Now I have tcmd jump to the correct directory (using the "/o" parameter), now I'll have to find a way to jump to the correct file. Using Search is not really an option since it also searches sub directories.
Now I have tcmd jump to the correct directory (using the "/o" parameter), now I'll have to find a way to jump to the correct file. Using Search is not really an option since it also searches sub directories.
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
Ah i see. I this case, what about filtering the view with the cm_ShowOnlySelected command? First you have to select the file with Ctrl-F12, then issue the cm_ShowOnlySelected command. This way you get some error checking, as if the file does not exist, the view will be empty.
I switched to Linux, bye and thanks for all the fish!
It just gave me the idea to use the same concept with locate (cf this thread).
Code: Select all
;Ctrl + F
~^f::
IfWinActive, Locate
{
;Put highlighted FullFileName in clipboard
ControlGetFocus, ActiveControl, A
Send, ^c
FullFileName = %clipboard%
SplitPath, FullFileName, name, dir
;MsgBox %name%
;MsgBox %dir%
;FullFileName = C:\My Documents\Address List.txt
;SplitPath, FullFileName, name, dir, ext, name_no_ext, drive
; The above will set the variables as follows:
; name = Address List.txt
; dir = C:\My Documents
; ext = txt
; name_no_ext = Address List
; drive = C:
;Open TotalCommander with the specified folder
Run, "C:\Program Files\Totalcmd\Totalcmd.exe" /o "%dir%"
Sleep 1000
;In TC you have to enable [Letters - with search dialog] in preference -> configuration -> operation -> quick search option
;Will move to the specified file name
Send %name%{Escape}
Return
}
Gil
Licence #17346
90% of coding is debugging. The other 10% is writing bugs.
Licence #17346
90% of coding is debugging. The other 10% is writing bugs.
2SanskritFritz
And still... what are the advantages of AHK? What AHK can that PP not?As I said, there no big reason to switch to AHK from PP. PP is a magnificent tool for those who are used to it. I am not, I used it for some months, but didnt like it due to the compromises i had to suffer. What I mean by that: yes PP offers StickyNotes, but ATNotes is way better. Yes it offers clipboard history, but CLCL is way better. Yes it offers scripts, but AHK is way better. Yes it offers hotkeys, toolbars etc, but AHK, etc is way better. So just the advantage that i have all these functionalities in one program did not justify PP for me, i have plenty of memory in my PC Wink
Conclusion: if you like PP, stick to it, but in the meanwhile check out the features of AHK, at first it will seem to be much more narrow than PP, but after you discover the strength of it, you will be amazed.
Excellent solution, gbo. And it's pretty easy to change that script to send Alt+letter if you need it... 
Using Locate plus AutoHotkey is really the best one can do. You only have to make sure that the database is always up-to-date!
I really hope that Locate like searching will be implemented in TC one day.
Edit: Corrected the code, now it opens a new tab to circumvent the problem of a running TC that is active in right panel, see bug report here:
http://www.ghisler.ch/board/viewtopic.php?t=9434
Other problem were an empty clipboard, missing focus in Locate, problematic sleep interval and wrongly positioned Return.
Icfu

Using Locate plus AutoHotkey is really the best one can do. You only have to make sure that the database is always up-to-date!

I really hope that Locate like searching will be implemented in TC one day.
Edit: Corrected the code, now it opens a new tab to circumvent the problem of a running TC that is active in right panel, see bug report here:
http://www.ghisler.ch/board/viewtopic.php?t=9434
Other problem were an empty clipboard, missing focus in Locate, problematic sleep interval and wrongly positioned Return.
Code: Select all
;Ctrl + F
~^f::
IfWinActive, Locate
{
;Put highlighted FullFileName in clipboard
ControlFocus, SysListView321
Send, ^c
ClipWait
FullFileName = %clipboard%
SplitPath, FullFileName, name, dir
;MsgBox %name%
;MsgBox %dir%
;FullFileName = C:\My Documents\Address List.txt
;SplitPath, FullFileName, name, dir, ext, name_no_ext, drive
; The above will set the variables as follows:
; name = Address List.txt
; dir = C:\My Documents
; ext = txt
; name_no_ext = Address List
; drive = C:
;Open TotalCommander with the specified folder
Run, "C:\Program Files\Totalcmd\Totalcmd.exe" /O /T "%dir%"
WinWaitActive, ahk_class TTOTAL_CMD
;In TC you have to enable [Letters - with search dialog] in preference -> configuration -> operation -> quick search option
;Will move to the specified file name
Send, %name%{ESCAPE}
}
Return
This account is for sale
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
Before putting something into the clipboard, I recommend to save its previous contents. This is taken from the AHK documentation:
Code: Select all
ClipSaved := ClipboardAll ; Save the entire clipboard to a variable of your choice.
; ... here make temporary use of the clipboard ...
Clipboard := ClipSaved ; Restore the original clipboard. Note the use of Clipboard (not ClipboardAll).
ClipSaved = ; Free the memory in case the clipboard was very large.
I switched to Linux, bye and thanks for all the fish!
Yes good advice, I am used to CLCL's convenience... but for people who don't use it, it can be quite frustrating to lose the clipboard's content.SanskritFritz wrote:Before putting something into the clipboard, I recommend to save its previous contents. This is taken from the AHK documentation:Code: Select all
ClipSaved := ClipboardAll ; Save the entire clipboard to a variable of your choice. ; ... here make temporary use of the clipboard ... Clipboard := ClipSaved ; Restore the original clipboard. Note the use of Clipboard (not ClipboardAll). ClipSaved = ; Free the memory in case the clipboard was very large.
Gil
Licence #17346
90% of coding is debugging. The other 10% is writing bugs.
Licence #17346
90% of coding is debugging. The other 10% is writing bugs.
Concerning the above AHK script:
It's superfluous!
You can achieve the same goal under Options -> Settings -> Keyboard shortcuts:
1. Activate Ctrl-F
2. Under "Advanced" set to "Local"
3. Under "Where pressed" check "Result list"
4. Action "Advanced"
5. SubAction "Execute command" (not Execute item!)
6. Command "C:\bla bla\totalcmd.exe" "%d"
Icfu
It's superfluous!
You can achieve the same goal under Options -> Settings -> Keyboard shortcuts:
1. Activate Ctrl-F
2. Under "Advanced" set to "Local"
3. Under "Where pressed" check "Result list"
4. Action "Advanced"
5. SubAction "Execute command" (not Execute item!)
6. Command "C:\bla bla\totalcmd.exe" "%d"
Icfu
Last edited by icfu on 2006-01-31, 15:31 UTC, edited 1 time in total.
This account is for sale
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary