AutoHotkey & Total Commander


AutoHotkey

Jump to: navigation, search

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

How does it work?

In order to make use of the following scripts you have to

  1. install AutoHotkey;
  2. save the script as WhateverYouLike.ahk (alternatively add it to the AHK autostart file AutoHotkey.ini);
  3. run it.

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.

Useful Scripts

GUI enhancements

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)

Automatic actions

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

User experience improvements

Menus and such

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)

Help with Copy/Move/Pack/Download

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)

Help with file panels

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)

Help with Config

AutoHotkey: Switch Language (by Sheepdog)

Help with the Clipboard

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)

Integration with external tools

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)

External (standalone) scripts

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)

Useful addons


External links


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
[c-sharp] view plain copy
  1. DetectHiddenWindows,On  
  2. ;~ DetectHiddenText,On  
  3. #t::run D:/k_wps_cn/greenTools/totalcmd/TOTALCMD.EXE /O  
  4.  
  5.  
  6. #e::  
  7. ;快捷键设定为Win + E  
  8. IfWinNotExist, ahk_class TTOTAL_CMD  
  9. ;判断TC是否启动  
  10.     Run, D:/k_wps_cn/greenTools/totalcmd/totalcmd.exe /O  
  11. ;~  #t::run d:/GREEN/totalcmd_703/TOTALCMD.EXE /O  
  12.   
  13. ;没启动则启动TC  
  14. Else  
  15. {  
  16.     IfWinActive, ahk_class TTOTAL_CMD  
  17. ;启动的话则判断TC窗口是否激活  
  18.        WinMinimize,   
  19. ;激活的话就最小化  
  20.     Else  
  21.        WinActivate,  
  22. ;没激活的话就激活  
  23. }  
  24. return  

2)鼠标中键打开新的Tab(不一定很必要)
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

转载于:https://my.oschina.net/alphajay/blog/149473

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值