# Adding files to collection problem

**URL:** <https://resource.dopus.com/t/adding-files-to-collection-problem/12180>\
**Category:** Help & Support\
**Created:** [December 24, 2011, 11:02am UTC](https://resource.dopus.com/t/adding-files-to-collection-problem/12180 "2011-12-24T11:02:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dp\_fan](https://resource.dopus.com/letter_avatar_proxy/v4/letter/d/c77e96/32.png) [@dp\_fan](https://resource.dopus.com/u/dp_fan)\
**Post date:** [December 24, 2011, 11:02am UTC](https://resource.dopus.com/t/adding-files-to-collection-problem/12180/1 "2011-12-24T11:02:04Z")

</div>

Hello,

I like to add files to a file collection.  
The button should do the following thing: select all files which contain in the filename "\_001", than create a collection folder with the name e.g. \_001, all selected files then should be added.  
The button works fine, it even creates a folder inside the file collection, but it does not ADD any files into the folder I have created.

Here is the code:

```auto
Set FLATVIEW=On,MixedNoFolders
@set index={dlgstringS|Type in index}
Clipboard SET {$index}
CreateFolder NAME="coll://{$index}" 
SELECT REGEXP "{$index}" HIDEUNSEL
```

Now the last line I took out: the one to tell the button to add the files to the collection.

I have tried 2 ways of adding the files to the files collection: none worked out.

a) Copy TO "coll://{$index}"  
b) Copy TO "coll://{clip}"

Can anyone give me please a hit on what I do wrong?!  
Thanks in advance !
