AutoHotkey: Send a command to Total Commander: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (Replaced dynamic rapidshare link by static totalcmd download link) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
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 [http://www.totalcmd.net/files/SendTCCommand_0.2.zip here available]. | |||
; Script name: SendTCCommand.ahk | ; Script name: SendTCCommand.ahk | ||
Line 14: | Line 18: | ||
; | ; | ||
; SendTCCommand 0. | ; SendTCCommand 0.2 | ||
; | ; | ||
; Function purpose: | ; Function purpose: | ||
Line 23: | Line 27: | ||
; xsTCCommand: The Total Commander internal command, see the list here: | ; xsTCCommand: The Total Commander internal command, see the list here: | ||
; %COMMANDER_PATH%\TOTALCMD.INC | ; %COMMANDER_PATH%\TOTALCMD.INC | ||
; xbWait: Whether to wait for the command to execute, | |||
; or just post it and return. | |||
; | ; | ||
; Usage example: | ; Usage example: | ||
; SendTCCommand( "cm_RereadSource" ) | ; SendTCCommand( "cm_RereadSource", False ) | ||
; | ; | ||
SendTCCommand( xsTCCommand ) | SendTCCommand( xsTCCommand, xbWait=1 ) | ||
{ | { | ||
loop Read, %COMMANDER_PATH%\TOTALCMD.INC | loop Read, %COMMANDER_PATH%\TOTALCMD.INC | ||
Line 40: | Line 46: | ||
} | } | ||
if (asCommandsValues1 > 0) | if !(asCommandsValues1 > 0) | ||
return | |||
if (xbWait) | |||
SendMessage 1075, %asCommandsValues1%, 0, , ahk_class TTOTAL_CMD | |||
else | |||
PostMessage 1075, %asCommandsValues1%, 0, , ahk_class TTOTAL_CMD | PostMessage 1075, %asCommandsValues1%, 0, , ahk_class TTOTAL_CMD | ||
} | } | ||
Line 46: | Line 57: | ||
Back to [[AutoHotkey]] | Back to [[AutoHotkey]] | ||
[[Category:AutoHotkey scripts|Send a command to Total Commander]] | |||
[[de:AutoHotkey: Schicke einen Befehl an den Total Commander]] | [[de:AutoHotkey: Schicke einen Befehl an den Total Commander]] |
Latest revision as of 11:35, 28 April 2009
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 }
Back to AutoHotkey