AutoHotkey is a complementary program which can be used to initiate operations and automate tasks in Total Commander. AutoHotkey is a scripting language (kind of programming language) specifically designed to create hotkeys, which in AutoHotkey terminology means mouse, joystick and keyboard shortcuts.
Another notable feature is hotstrings (requires Windows NT/2000/XP or later). Hotstrings are basically the same as hotkeys except that they are triggered when a certain piece of text is typed. They are mainly used to automatically replace typed text with other texts but can be used to trigger any scripted action.
Getting started is not very hard. Just take a look at AutoHotkey's help file which is suited for beginners and advanced users as well and will help you to create your own scripts in no time.
Be aware that some AHK-Scripts with different versions of Windows do not work properly or possibly do not work at all.
Contents
|
In order to make use of the following scripts you have to
or
you compile the script with Ahk2Exe.exe (available in the zip-file at the AHK Download page). Thus you get a standalone exe-file you can run on each PC without Autohotkey installed. Disadvantage: You can't modify this compiled exe anymore.
AutoHotkey: Drives Tooltip (by SanskritFritz)
AutoHotkey: Move Quicksearch Box To Make Status Bar Visible (by Icfu)
AutoHotkey: Show elapsed / remaining / total / start / finish times in title bar of progress dialogs (by Hacker)
AutoHotkey: Show the active path in the title bar (by SanskritFritz)
AutoHotkey: Show the active path in the title bar extended (by StatusQuo)
AutoHotkey: TC Fav Menu (by majkinetor)
AutoHotkey: Tray Icon for TC (by SanskritFritz)
AutoHotkey: Keyboard navigation for Background Transfer Manager (by StatusQuo)
AutoHotkey: From FileSync open another TC instance with selected files (by StatusQuo)
AutoHotkey: Automatic directory-specific configuration / actions (by Hacker)
AutoHotkey: Alt-Tab fix when minimized to tray (by TucknDar)
AutoHotkey: Reset the MultiRenameTool automatically (by SanskritFritz, Sheepdog)
AutoHotkey: Run or activate Total Commander (by SanskritFritz)
AutoHotkey: Auto-Delete BAK-files created by TC's File-Compare-Editor (by StatusQuo)
AutoHotkey: Launch a putty session out of an active sftp-plugin connection within TC (by TWatcher
AutoHotkey: Makedir and file create history (by Jungle)
AutoHotkey: Popup menu for button bar or F4 (by Mbirth)
AutoHotkey: Popup the splitter menu (by SanskritFritz)
AutoHotkey: Duplicate starter menu entry (or entry in directory hotlist) (by StatusQuo)
AutoHotkey: Always copy / move in Queue (by Hacker)
AutoHotkey: Auto add URL to Background transfer manager (by Hacker)
AutoHotkey: Inplace rename with dialog (by Icfu, SanskritFritz)
AutoHotkey: Shutdown computer after download or copy (by SanskritFritz)
AutoHotkey: Unpack each archive to a separate subdir (by Icfu, Icfu, Hacker)
AutoHotkey: Automatically assign name for archive (by saturn)
AutoHotkey: AppendLnk option for packing (plus: Automatically assign name for archive) (by StatusQuo)
AutoHotkey: Move selected files to parent directory (by ArchCarrier)
AutoHotkey: Backspace In Drive Root Opens My Computer (by Icfu)
AutoHotkey: Double click resets the splitter (by SanskritFritz)
AutoHotkey: Find Previous Match With Ctrl Shift Enter (by Icfu)
AutoHotkey: Go To Parent Directory When Doubleclicking Border (by Icfu)
AutoHotkey: Jump To The Next File Extension (by Icfu)
AutoHotkey: Mark Important Files Permanently (by Icfu)
AutoHotkey: Middle click opens new tab (by SanskritFritz)
AutoHotkey: ScrollLock functionality (by SanskritFritz)
AutoHotkey: Simultaneous switch to next/previous Tab in both panes (by Sheepdog)
Autohotkey: Spread Selection with Parameter (by Sheepdog)
AutoHotkey: With Alt - \ always to root of drive (by Sheepdog)
Autohotkey: When switching panels also transfer file selection (by StatusQuo)
Autohotkey: (Un)select all files in both panels with a single key combination (by StatusQuo)
AutoHotkey: Switch Language (by Sheepdog)
AutoHotkey: CopyNamesToClipWithoutExt (by Icfu, Hacker)
AutoHotkey: Copy Filename To Clipboard When Inplace-renaming (by Icfu)
AutoHotkey: Copy Selection To Clipboard In Lister (by Icfu)
AutoHotkey: Get the ftp address as hyperlink (by SanskritFritz)
AutoHotkey: Launch external diff (by SanskritFritz)
AutoHotkey: XML tidy for TC File Compare tool (by tomte)
AutoHotkey: Locate in TC (by SanskritFritz)
AutoHotkey: Paste TC's active path anywhere (by Hacker, SanskritFritz)
AutoHotkey: Send a command to Total Commander (by SanskritFritz)
AutoHotkey: Send a command to Total Commander (Accurate Version) (by Balderstrom)
AutoHotkey: Start Notepad In Lister (by Icfu)
AutoHotKey: Explorer Directory Tree (by Vigk)
AutoHotkey: Send a user command to Total Commander (by sunwind)
AutoHotkey: Copy and Paste of Exif via ExifTools (by Nikolay Cherkasov)
AutoHotkey: Close or minimize windows (by SanskritFritz)
AutoHotkey: Combine file parts (by Hacker)
AutoHotkey: Create .bat file to combine file parts (by Hacker)
AutoHotkey: Create folders from filenames (by Icfu)
AutoHotkey: Inplace rename facilities (by Gbo)
AutoHotkey: Make a Screenshot of the current Window with Irfanview (by Sheepdog)
AutoHotkey: Refresh the treeinfo.wc of certain drives (by Sheepdog)
AutoHotkey: Set folder timestamp to newest file (by SanskritFritz)
AutoHotkey: Make shortcut file from clipboard contents (by StatusQuo)
AutoHotkey: Launch putty or RDP sessions via a tree-driven selection menu (by mrbinary)
AutoHotkey 在TC中应用
http://bbs.deepin.org/thread-888810-1-1.html
Autohotkey在TC中的应用—包括TrayIcon的Alt-Tab问题
偶逛TC的wiki,才发现有脚本这一块,把喜欢的Autohotkey所有文章翻了一遍,找出几个自己喜欢的整理一下,可能是我孤陋寡闻,见笑了:)。也学习AHK是如何来控制TC的,以便以后DIY。
Autohotkey的应用请google一下,很简单的。
(http://chenqj.blogspot.com, qjchen,在DEEPIN无法注册到qjchen,只好另外注册一个了:))
1)让TC在trayicon的情况下ALT-TAB时不用再按enter,这个问题在TC论坛上也颇久了,G兄似乎也没有想去解决之。所以有如下ahk。
#Persistent
#SingleInstance force
#NoTrayIcon
SetTimer subTimer, 500
subTimer:
If WinActive( /"ahk_class switchwin2/" )
{
SendInput, {Enter}
}
Return
cm_OpenDirInNewTab := 3003
#IfWinActive ahk_class TTOTAL_CMD
$MButton::
MouseGetPos, , , , sControl
if (sControl != /"TMyListBox1/" and sControl != /"TMyListBox2/")
{
Send {MButton}
Return
}
Click
PostMessage 1075, %cm_OpenDirInNewTab%, 0
Return
3)通过热键调整splitter(就是用键盘调用窗口分隔条,可能是我愚笨,没有在TC的command中找到这个键盘快捷键)
http://www.ghisler.ch/wiki/index ... p_the_splitter_menu
; Win-G (Total Commander: splitter menu)
~#g::
if not WinActive( /"ahk_class TTOTAL_CMD/" )
Return
WinGet sf_aControls, ControlList
Loop Parse, sf_aControls, `n
{
StringLeft sf_sTemp, A_LoopField, 6
if (sf_sTemp = /"TPanel/")
{
ControlGetPos Cx,Cy,Cw,Ch, %A_LoopField%
if (Cw < 16)
{
ControlClick %A_LoopField%, A,,RIGHT
Break
}
}
}
Return
4)TC Fav Menu
http://www.ghisler.ch/wiki/index.php/AutoHotkey:_TC_Fav_Menu
文件较大
这个可以把TC的收藏夹也作为可以为资源管理器所用,也可以作为Open和save时候所用
5)在TC的标题栏里面显示文件路径(这个是用来开心的吧,自己加点什么有趣的信息上去TITLE)
#Persistent
SetTimer subTimer, 250
subTimer:
if WinActive( /"ahk_class TTOTAL_CMD/" )
{
ControlGetText sPath, TMyPanel2
StringMid sPath, sPath, 1, StrLen(sPath) -1
WinGetTitle sWindowTitle
if ( sWindowTitle != sPath )
WinSetTitle %sPath%
}
Return
6)在进度条上显示进度的已用时间,剩余时间,总时间,和开始结束时间
http://www.ghisler.ch/wiki/index ... of_progress_dialogs
代码颇长。
在进度条激活的情况下,按shift键就可以了。
7)给工具栏图标Toolbar Icon增加弹出菜单,可以多项启动参数。
http://www.ghisler.ch/wiki/index ... or_button_bar_or_F4
8)最大化窗口的情况下,双击窗口的最左边或者最右边将去到相应的根目录
RegRead, DoubleClickSpeed, HKEY_CURRENT_USER, Control Panel//Mouse, DoubleClickSpeed
If DoubleClickSpeed =
DoubleClickSpeed = 500
~LButton::
IfWinActive, ahk_class TTOTAL_CMD
{
If A_TimeSinceThisHotkey >= %DoubleClickSpeed%
ClickCount = 0
MouseGetPos, xcoordinate
If xcoordinate = 4
{
ClickCount++
PostMessage 1075, 4001, , , ahk_class TTOTAL_CMD
}
If (xcoordinate = A_ScreenWidth+3)
{
ClickCount++
PostMessage 1075, 4002, , , ahk_class TTOTAL_CMD
}
If ClickCount = 2
{
PostMessage 1075, 2002, , , ahk_class TTOTAL_CMD
ClickCount = 0
}
}
Return
AutoHotkey: Send a command to Total Commander
Jump to: navigation, search
The purpose of this script is to send an internal command to Total Commander (e.g. from a batch file). Useful to collect some tasks to automate them for usage with a Button.
A compiled version of this script is here available.
; Script name: SendTCCommand.ahk ; Sends a Total Commander command to a TC instance. ; Can be used from the scheduler for example. ; Specify the TC command as command line parameter for example: ; AutoHotkey.exe SendTCCommand.ahk cm_FtpNew ; Or if the script is compiled: ; SendTCCommand.exe cm_FtpNew sCmdParam = %1% SendTCCommand( sCmdParam ) Return ; ; SendTCCommand 0.2 ; ; Function purpose: ; Sends a Total Commander internal command to a TC instance. ; It can be used to automate Total Commander. ; ; Parameters: ; xsTCCommand: The Total Commander internal command, see the list here: ; %COMMANDER_PATH%\TOTALCMD.INC ; xbWait: Whether to wait for the command to execute, ; or just post it and return. ; ; Usage example: ; SendTCCommand( "cm_RereadSource", False ) ; SendTCCommand( xsTCCommand, xbWait=1 ) { loop Read, %COMMANDER_PATH%\TOTALCMD.INC { StringSplit asCommands, A_LoopReadLine, = if (asCommands1 = xsTCCommand) { StringSplit asCommandsValues, asCommands2, `; Break } } if !(asCommandsValues1 > 0) return if (xbWait) SendMessage 1075, %asCommandsValues1%, 0, , ahk_class TTOTAL_CMD else PostMessage 1075, %asCommandsValues1%, 0, , ahk_class TTOTAL_CMD