selecting file then apply command with button bar?

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
pajo
Member
Member
Posts: 181
Joined: 2005-02-18, 17:57 UTC
Location: Croatia

selecting file then apply command with button bar?

Post by *pajo »

This is the thing:
I wanna create barbutton, which will point to some file and automaticly prewiev it. Is it possible to do that??
Example for eventlog plug in:
"cd %systemroot%\system32\config\appevent.evt" and then "cm_SrcQuickview (Source: Quick view panel)"

Thanks
User avatar
franck8244
Power Member
Power Member
Posts: 704
Joined: 2003-03-06, 17:37 UTC
Location: Geneva...

Post by *franck8244 »

You can do it with TCScript Editor (select the file then cm_SrcQuivKView), or with other scripting tools...

Here is the code for your example (with TCScript Editor):

Code: Select all

#include VKeys.h
//Go to the desired directory (!! it will set then delete the clipboard...)
SendCmd(cm_focuscmdline);
Setclipbrd("cd %WINDIR%\system32\config\");
SendVKey(17,1);
SendVKey(86,2);
SendVKey(17,0);
SendVKey(VK_RETURN,2);
DelClipbrd();
//Select the wanted file by typping the first letters
SendVKey(65,2);  //A
SendVKey(80,2);  //P
SendVKey(80,2);  //P
SendVKey(69,2);  //E
//type more letters if there is more similar files

//QuickView It
SendCmd(cm_SrcQuickview);
It works with QuickSearh (current Dir) set to "Letters only" (in Configurations->Options->Operation) otherwise you will have to modify this code ...
TC#88260 -
User avatar
Sam_Zen
Power Member
Power Member
Posts: 700
Joined: 2005-02-08, 22:59 UTC
Location: NL
Contact:

Post by *Sam_Zen »

As long as a file-extension is associated with some application, you can make a button for such file on the bar, pointing to that file and it will start the application, and open with the specific file. So I have a button for my daily used log-txt-file where I save temporary notations, which starts my ascii-editor plus that file for standby.
Post Reply