Page 1 of 1

[HELP] Scripting : copy to clipboard in specific format ?

Posted: 27 Mar 2013 04:15
by xen
hello ,
May i ask for a script like this
when selecting multiple file(for example file1.jpg,file2.txt, file3.jpg, file4.doc) the script will copy to clipboard in this format

"file1.jpg" "file2.txt" "file3.jpg" "file4.doc"

(Only file names ,not contain paths)

(the order of the file is sorted by current sorting mode(which we choose in view=> sort by ..)
- like the result list when we select "to clipboard=>items name(s)"
Thanks in advance

Re: [HELP] Scripting : copy to clipboard in specific format

Posted: 27 Mar 2013 05:58
by highend

Code: Select all

$copyString = "";
	foreach ($item, "<get SelectedItemsNames |>", "|") {
		$copyString = $copyString . quote($item) . " ";
	}
	copytext $copyString;

Re: [HELP] Scripting : copy to clipboard in specific format

Posted: 27 Mar 2013 07:25
by xen
Thank so much highend ,you made my day :mrgreen:

Re: [HELP] Scripting : copy to clipboard in specific format

Posted: 27 Mar 2013 13:15
by TheQwerty
May I eliminate your string-building loop? :wink:

Code: Select all

CopyText Quote(Get('SelectedItemsNames','" "'));
Or if you want to sacrifice legibility for one less instance of the stepping dialog...

Code: Select all

CopyText '"' . Get('SelectedItemsNames','" "') . '"';

Re: [HELP] Scripting : copy to clipboard in specific format

Posted: 27 Mar 2013 15:15
by xen
TheQwerty wrote:May I eliminate your string-building loop? :wink:

Code: Select all

CopyText Quote(Get('SelectedItemsNames','" "'));
Or if you want to sacrifice legibility for one less instance of the stepping dialog...

Code: Select all

CopyText '"' . Get('SelectedItemsNames','" "') . '"';
Thank you ,TheQwerty ^^ i really aprreciate it :D