文档章节

AutoHotkey & Total Commander

AlphaJay
 AlphaJay
发布于 2013/08/02 15:44
字数 1847
阅读 835
收藏 0

「深度学习福利」大神带你进阶工程师,立即查看>>>


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

AlphaJay
粉丝 80
博文 284
码字总数 313790
作品 0
杭州
私信 提问
加载中
请先登录后再评论。
CDH5: 使用parcels配置lzo

一、Parcel 部署步骤 1 下载: 首先需要下载 Parcel。下载完成后,Parcel 将驻留在 Cloudera Manager 主机的本地目录中。 2 分配: Parcel 下载后,将分配到群集中的所有主机上并解压缩。 3 激...

cloud-coder
2014/07/01
6.9K
1
Elasticsearch 2.3.0 新增:查询更新接口update-by-query

查询更新接口是2.3.0增加新接口,这个接口目前是实验性的。此接口可能会在未来的版本中改变。此接口在索引中更新每一个文档,而文档的内容并没有改变的情况下使用,这在增加新的属性或者修改...

赛克蓝德
2016/04/07
5.3K
0
Elasticsearch 2.20 从新评分

在Elasticsearch中,搜索单个单词是比较快的,当搜索短语的时候,效率会比较低。所以Elasticsearch提供了从新评分的方法来提高效率。他的原理主要是当在整个索引中搜索短语消耗的资源会比较多...

赛克蓝德
2016/02/14
1.5K
1
Professional Android Wearables

《Professional Android Wearables》---《专业的Android可穿戴应用开发》 本书撰稿的专家作者团队拥有多年的动手设计和建设Android wearables的经验,《Professional Android Wearables》介绍...

wgfeng
2015/08/24
25
0
Oracle录屏命令spool的使用

SPOOL可以把Oracle客户端SQLPLUS的输出导入到一个文本中,可以导出html、CSV等形式,其语法如下: spool [rep/append] 屏幕输出保留到指定文件中,如果文件存在想替换内容使用replace,追加内...

大王叫我来巡山Zd
2016/04/13
1
0

没有更多内容

加载失败,请刷新页面

加载更多

汇总你在 Linux 上的命令使用情况

使用合适的命令,你可以快速了解 Linux 系统上使用的命令以及执行的频率。 汇总 Linux 系统上使用的命令只需一串相对简单的命令以及几条管道将它们绑定在一起。当你的历史记录缓冲区保留了最...

osc_bvincwvq
2分钟前
0
0
Hacker News 简讯 2020-08-15

最后更新时间: 2020-08-15 07:01 Welders set off Beirut blast while securing explosives - (maritime-executive.com) 焊工在固定炸药的同时引爆了贝鲁特爆炸 得分:383 | 评论:322 Factor......

FalconChen
今天
24
0
OSChina 周六乱弹 —— 老椅小猫秋乡梦 梦里石台堆小鱼

Osc乱弹歌单(2020)请戳(这里) 【今日歌曲】 @小小编辑 :《MOM》- 蜡笔小心 《MOM》- 蜡笔小心 手机党少年们想听歌,请使劲儿戳(这里) @狄工 :腾讯又在裁员了,35岁以上清退,抖音看到...

小小编辑
今天
111
3
构建高性能队列,你不得不知道的底层知识!

前言 本文收录于专辑:http://dwz.win/HjK,点击解锁更多数据结构与算法的知识。 你好,我是彤哥。 上一节,我们一起学习了如何将递归改写为非递归,其中,用到的数据结构主要是栈。 栈和队列...

彤哥读源码
今天
17
0
Anaconda下安装keras和tensorflow

Anaconda下安装keras和tensorflow 一、下载并安装Anaconda: Anaconda下载 安装步骤: 如果是多用户操作系统选择All Users,单用户选择Just Me 选择合适的安装路径 然后勾选这个,自动配置环境...

Atlantis-Brook
今天
15
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部