CopyLine plugin for Take Command / TCC / TCC/LE

version 1.0.5     2023-10-13

Charles Dye

Purpose:

This plugin provides a hotkey, Alt-C, to copy the current command line to the clipboard. There is also one new command, COPYLINE, to configure plugin options.

Installation:

To use this plugin, copy CopyLine.dll to some known location on your hard drive. (If you are still using the 32-bit version of Take Command, take CopyLine-x86.dll instead of CopyLine.dll.) Load the .DLL file with a PLUGIN /L command, for example:

plugin /l c:\bin\tcmd\test\copyline.dll

If you copy these files to a subdirectory named PlugIns within your Take Command program directory, the plugin will be loaded automatically when TCC starts.

Syntax Note:

The syntax definitions in the following text use these conventions for clarity:

BOLD CODEindicates text which must be typed exactly as shown.
CODEindicates optional text, which may be typed as shown or omitted.
Bold italicnames a required argument; a value must be supplied.
Regular italicnames an optional argument.
ellipsis…after an argument means that more than one may be given.


New Hotkey:

CopyLine (Alt-C) — Copies the current command line to the clipboard.

The entire command line will be copied. There is no need to select a portion to copy. If there is nothing on the command line, this hotkey does nothing (it will not empty the clipboard).

If the copy succeeds, it will make a success beep; use COPYLINE /C: to change this behavior. If it fails for some reason, it will make the default TCC error beep; use COPYLINE /E: to change this.

You can change the hotkey with COPYLINE /K:.



New Command:

COPYLINE — Display and change plugin settings.

Syntax:
COPYLINE /C:sound /D /E:sound /K:key /L /R /S

/C:soundset the CopyLine success soundSuccess
/Drestore the default plugin settings 
/E:soundset the CopyLine error soundError
/K:keyset the CopyLine hotkeyAlt-C
/Llist all supported hotkeys 
/Rrestore saved settings to the registry 
/Ssave the current settings to the registry 

You can specify a different CopyLine hotkey with /K:. To see a list of all supported hotkeys, use /L. (The list can vary between different versions of TCC, because the plugin hotkey interface changed in version 24.) Note that some key combinations may not be seen by the plugin — they might be used by the console, or by Take Command. If your hotkey doesn’t work, try changing it back to Alt-C.


Valid sounds for /C: and /E: include:

Noneno sound 
Successa happy little beep1
ErrorTCC’s default error beep2
Asteriskthe system ‘Asterisk’ sound3
Questionthe system ‘Question’ sound3
Handthe system ‘Critical Stop’ sound3
Exclamationthe system ‘Exclamation’ sound3
Default or OKthe system ‘Default Beep’ sound3
filenameonly .WAV files are supported 

Note 1: This sound is built into the plugin. I got it from https://freesound.org/people/PaulMorek/sounds/330046/.

Note 2: This beep is configured in the OPTION dialog, on the ‘Advanced’ tab.

Note 3: The system sounds are configured through the Sound control panel, on the ‘Sounds’ tab.


/D restores the original plugin default settings. /R restores the settings saved to the registry, if any. You cannot combine the two.

/S saves the current settings to the registry. They will be loaded automatically the next time you load this plugin.



Startup Message:

This plugin displays an informational line when it initializes. The message will be suppressed in transient or pipe shells. You can disable it for all shells by defining an environment variable named NOLOADMSG, for example:

set /e /u noloadmsg=1

Status and Licensing:

This plugin is © Copyright 2023, Charles Dye. Unaltered copies of the binary and documentation files may be freely distributed without restriction. I make no guarantee and give no warranty for its operation. If you find a problem, you can report it in the JP Software support forum.

Download:

You can download the current version of the plugin from http://charlesdye.net/dl/copyline.zip.