Page 1 of 1

Work on all selected <items> or save temp list of <items>

Posted: 15 Oct 2009 11:04
by Stefan
Hi all,
i have seen this "TeraCopy Integration" thread
and was wondering why is there that workaround - copy items to clipboard - save as file - ...

So i tried this with using "<items>" without any success.
run "X:\TeraCopy.exe copy <items> $target";
openwith "X:\TeraCopy.exe" copy "<items>" $Target;
openwith "X:\TeraCopy.exe" copy ""<items>"" ""$Target"";



Then i tried also with an simpler use:
msg <curitem>;
works on a few selected files, but shows only one file name, as expected.
msg <items>; didn't works, even quoted, shows only '<items>' literally .

Question:
can't i use <itemS> that way?



And i wonder why is there no var like <itemlist> , <baselist> , <namelist>
which stores an text file with all selected items in tmp under an temp name like xy3zhu.tmp
and so we can simply use this as parameter for such tools? Should i post this as an suggestion?

create a list file in the TEMP directory
with the names of the selected files and directories, and appends the name of the list file to the command line.
The list is deleted automatically when the called program quits. 6 types of list files can be created:

%L Long file names including the complete path, e.g. c:\Program Files\Long name.exe
%l (lowercase L) Short file names including the complete path, e.g. C:\PROGRA~1\LONGNA~1.EXE
%F Long file names without path, e.g. Long name.exe
%f Short file names without path, e.g. LONGNA~1.EXE
%D Short file names including the complete path, but using the DOS character set for accents.
%d Short file names without path, but using the DOS character set for accents.
%UL, %UF like %L and %F, but with an UTF-8 Unicode list file (with byte order marker)
%WL, %WF like %L and %F, but with an UTF-16 Unicode list file (with byte order marker)

Re: Work on all selected <items> or save temp list of <items>

Posted: 15 Oct 2009 13:36
by Muroph
Stefan wrote:Question:
can't i use <itemS> that way?
nope.
<items> is not a xy variable.
to get a list of all selected items you can use the getinfo and report functions.
getinfo is pretty simple and is well explained in the help file.
report is more a bit more complex, but can do some neat things once you get used to it.
examples:

Code: Select all

text getinfo("selecteditemsnames","<crlf>/ITEM/<crlf>"); //list names of selected items, using a custom separator
  text report("{dir {fullpath}<crlf>||}",1); //list the full path of selected folders
Stefan wrote:and was wondering why is there that workaround - copy items to clipboard - save as file - ...
"copy to clipboard - save as file" was only used on the first versions, before we had an easy way to write data to a file.
besides, it's not really a workaround, it's just how teracopy's command line works.
AFAIK, to pass more than one item you have to put their path in a plain text file, one per line.

Re: Work on all selected <items> or save temp list of <items>

Posted: 15 Oct 2009 14:21
by Stefan
Muroph wrote:
Stefan wrote:Question:
can't i use <itemS> that way?
nope.
<items> is not a xy variable.
Ah, thanks for clarifying!
I mixed this up.
<items> looks like an var, but is an arg for >OpenWith<


Muroph wrote: to get a list of all selected items you can use the getinfo and report functions.
GetInfo, i see. I try to remember it :lol:

Muroph wrote:
Stefan wrote:and was wondering why is there that workaround - copy items to clipboard - save as file - ...
besides, it's not really a workaround, it's just how teracopy's command line works.
Yes, TerraCopy may work that way, my wondering was only about the XY workaround to save an temporary file list.
Now i know an way without using the clipboard. It is more flexible but hard to find.
Because I am used to use just an predefined argument like %L ( or <itemslist>, maybe Donald makes an note in his todo list)

Anyway, it works if you know how, thank you for the explanation.

Code: Select all

	$items = getinfo("selecteditemsnames","<crlf>"); //list names of selected items
	    writefile("%tmp%\filename.txt", $items);
	    run notepad "%tmp%\filename.txt";

Code: Select all

	writefile("%tmp%\filename2.txt", getinfo("selecteditemsnames","<crlf>"));
	    run notepad "%tmp%\filename2.txt";

Code: Select all

	$tmp = %tmp%\xy.<date ddhhnnss>;                            // path/file for temp file
	   writefile($tmp, getinfo("selecteditemsnames","<crlf>")); // write collected items to temp file
	   run notepad $tmp;                                      // do your work here
	   delete 0, 0, $tmp;                                      // clean up
GetInfo, GetInfo, GetInfo, Getinfo Getinfo getinfo getinfo getinfo getinfo getinfo getinfo getinfo collecting collect files get all files list of files filelist fileslist listfile list files