Script to copy files to different directories

Discuss and share scripts and script files...
Post Reply
zzjean
Posts: 81
Joined: 22 Nov 2009 14:56

Script to copy files to different directories

Post by zzjean »

Hello,
I have a script that a forum member wrote for me (thanks to him) that allows me to copy selected files into defined directories:

$dstFolders = <<<>>>
X:\folder_1
X:\folder_3
P:\folder_2
>>>;
setting "BackgroundFileOps", 0;
$items = get("SelectedItemsPathNames", "|");
if !($items) { status "No items selected, aborted...", "", "stop"; end 1==1; }
foreach($folder, $dstFolders, "<crlf>") {
if !(exists($folder)) { new($folder, "dir"); }
copyto $folder, $items;

I would like to improve this script to be able to choose the directories to copy the files to. I'm a complete beginner and don't know how to do it. Can anyone help me ?
Thank you so much

highend
Posts: 13033
Joined: 06 Feb 2011 00:33

Re: Script to copy files to different directories

Post by highend »

be able to choose the directories to copy the files to
From the folders in $dstFolders?

If yes, add that line (with same indention) after the >>>; one:

Code: Select all

$dstFolders = inputselect("Select folder(s)", $dstFolders, <crlf>, 1+2+32+16384, , 600, 500);
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

zzjean
Posts: 81
Joined: 22 Nov 2009 14:56

Re: Script to copy files to different directories

Post by zzjean »

Thanks for your help. Yes, that's what I want.
But, sorry, it doesn't work

If I do :


I have this


With this :

I have :


It’s a little better !
So, could you help me a little more
Thank you

jupe
Posts: 2669
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Script to copy files to different directories

Post by jupe »

highend wrote: 10 Dec 2023 18:18 If yes, add that line (with same indention) after the >>>; one:

zzjean
Posts: 81
Joined: 22 Nov 2009 14:56

Re: Script to copy files to different directories

Post by zzjean »

sorry, i forgot the attachements
Attachments
doc_1.png
doc_1.png (22.01 KiB) Viewed 273 times
Doc_2.png
Doc_2.png (7.36 KiB) Viewed 273 times
Doc_3.png
Doc_3.png (17.65 KiB) Viewed 273 times
Doc_4.png
Doc_4.png (6.79 KiB) Viewed 273 times

RalphM
Posts: 1911
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Script to copy files to different directories

Post by RalphM »

Read & follow the instructions. :whistle:
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

zzjean
Posts: 81
Joined: 22 Nov 2009 14:56

Re: Script to copy files to different directories

Post by zzjean »

I don't know how I did it, but it finally works.
My life is going to be better now :D
Thank you all for your help and patience

Post Reply