Page 1 of 1

Parametrized command COPYSTR

Posted: 2009-08-29, 11:46 UTC
by MVV
Yesterday Balderstrom and I discovered that currently TC has no way to export useful information like content plugin data etc. So, I suggest to make a new command like COPYSTR with parameter that may contain traditional %P, %S or %L parameters but also support plugins.

I.e., I want to copy reparse point target path, which may be returned by [=ntlinks.Obj_Type] string, so I create a button with command COPYSTR "%P points to [=ntlinks.Obj_Type]".

Also I suggest to add some command for copying such data for all selected files/folders, so if I execute command like COPYSTRALL "%P%N\t[=tc.file type]\t[=ntlinks.Obj_Type]", I'll get in clipboard such info for each selected file/folder.

Currently TC supports generating such strings for parameters strings, custom columns etc. So there should be some generic function that will write into some buffer such strings. And we need only to add a command for copying this string into clipboard. :)

Posted: 2009-08-30, 03:55 UTC
by Balderstrom
Support++ (Of course) :twisted:

Posted: 2009-08-30, 09:05 UTC
by Balderstrom
@ MVV : I'd recommend changing the COPYSTR in the Thread Title to something like: WDXCOPY

Also I don't think it really needs parameterized support, defaulting to whatever the cursor is on and/or whatever files are selected in the active panel would more than suffice, no?

I have found a really inconvenient workaround with TCMC.exe,
Sending 4 commands:
%Commander_Path%\Tools\TCMC.exe 50 CMcm_SrcLong CMcm_SrcNextCustomView CMcm_CopyFileDetailsToClip CMcm_SrcLong
That fetches far too much info: The full details of the current Custom Column (which was changed just prior to copy to clip) -- so it would need to be post-processed via a script|filter. Then yer at 2 separate buttons and a batch script to process the clipboard contents ... just to get a piece of info from the CustomColumn :P

Posted: 2009-08-30, 10:05 UTC
by MVV
I don't think adding parameters support is hard and maybe someone will need some fields that available only through %-params.

Posted: 2009-08-30, 11:21 UTC
by Balderstrom
I've found WdxInfoPacker, but the amount of time I've wasted trying to get it configured is crazy. Plus it appears to be buggy and doesn't like Wdx's that use underscores (And possibly "#" - but not sure if that one is still an issue). I can't get it to return anything but "1" for any of the ntlinks fields.
Plus if you try and use it on a Folder, instead of giving you info on the Folder, it tries to pack the folder.

The best bet I have right now, is prolly going to be an AHK script:
* change TC to CustomColumn #1,
* do a cm_CopyFileDetailsToClip,
* regex filter based on the embedded \t (tabs) to grab the field I want.
* copy result back to ClipBoard
* change the CustomColumn back to Details.

This request is unlikely, due to the fact you can copy file details, which includes CustomColumns - so long as you are currently using that custom column. And also due to the fact that "WdxInfoPacker" exists. Except its a serious pain to configure and if you can actually get it to work, it's extreme overkill when all you want is to fetch a couple (or even one) Wdx field.

WdxInfoPacker tries to do way too many things in a cramped interface, Data Collection, Text Formatting, Filtering, Text Replacement, etc. and finally text output to a file. Apparently there is also a CopyInfo2Clip.exe included with it, but you need to create a valid scheme.ini first. And I'm tired of trying to make it do something basic.

Posted: 2009-08-30, 14:05 UTC
by ghisler(Author)
currently TC has no way to export useful information like content plugin data
Actually there is a way: Switch to a custom columns view of your choice, select some files, and choose Mark - Copy names with all details.

Posted: 2009-08-30, 14:07 UTC
by MVV
ghisler(Author) wrote:
currently TC has no way to export useful information like content plugin data
Actually there is a way: Switch to a custom columns view of your choice, select some files, and choose Mark - Copy names with all details.
Yes, this thing I'd missed. But this way is not very comfortable, especially if you need one field of one file.

Posted: 2009-08-30, 17:07 UTC
by Balderstrom
Yeah, WdxInfoPacker does a bunch of "StringReplace(filename,'_', ' '" of underscores in the source (I don't know why).

Also, the CopyInfo2Clip.exe source has some very strange lines:
Course, I haven't coded in Pascal since 1993 so I'm more than rusty.

Posted: 2009-09-03, 11:48 UTC
by Balderstrom
@ MVV, I have a solution, but its a script... so you prolly wont like it ;-)

AHK Script, Activated by WIN+O (easy to change)
Requires you have a Custom Column named RP_Target (easy to change)
that contains as its first column: [=ntlinks.RP_Target]

Code: Select all

CheckTCRedirect( iniSection )
	wincmd = %COMMANDER_INI%
	iniRead, iniRedirect, %wincmd%, %iniSection%, RedirectSection, %wincmd%
	SplitPath, iniRedirect, iniFile, iniPath
	if( !iniPath )
		SplitPath, wincmd, tmpFile, iniPath
	return iniPath . "\" . iniFile 

iniReadTC( iniSection, iniKey )
	iniFile := CheckTCRedirect( iniSection )
	IniRead, keyValue, %iniFile%, %iniSection%, %iniKey%, %A_Space%
	return keyValue

	ifWinActive, ahk_class TTOTAL_CMD
		customColumnNames := iniReadTC( "CustomFields", "Titles" )
		if( InStr(customColumnNames, "RP_Target") )
			StringSplit, ccArray, customColumnNames, |
			Loop, %ccArray0%
				if( ccArray%A_Index% == "RP_Target" )
					dx := A_Index

			MsgBox, Requires a Custom Column named: RP_Target,`nThat has: [=ntlinks.RP_Target] as the first column

		WinGet, aApp
		MouseGetPos, ,,,aControl
		lParam := 0x1587		; Right Panel
		if( aControl == "TMyListBox2" )
			lParam := 0x1586	; Left Panel
		SendMessage, 0x433, %lParam%, %dx%,,ahk_id %aApp%
		SendMessage, 0x433, 0x7F4	; cm_CopyFileDetailsToClip
		SendMessage, 0x433, 0x12E ; cm_SrcLong (Details)
		StringSplit, rpTarget, Clipboard, %A_Tab%
		Clipboard := rpTarget2
		ClipWait, 1
		MsgBox, %Clipboard%
It's pretty specific atm, but easy enough to break it into a function that can query for any CustomColumn.