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

Discuss and share scripts and script files...
Post Reply
xen
Posts: 52
Joined: 27 Mar 2013 03:57

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

Post 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

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

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

Post by highend »

Code: Select all

$copyString = "";
	foreach ($item, "<get SelectedItemsNames |>", "|") {
		$copyString = $copyString . quote($item) . " ";
	}
	copytext $copyString;
One of my scripts helped you out? Please donate via Paypal

xen
Posts: 52
Joined: 27 Mar 2013 03:57

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

Post by xen »

Thank so much highend ,you made my day :mrgreen:

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

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

Post 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','" "') . '"';

xen
Posts: 52
Joined: 27 Mar 2013 03:57

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

Post 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

Post Reply