# How to AddFile from destination tab (Selected files)

**URL:** <https://resource.dopus.com/t/how-to-addfile-from-destination-tab-selected-files/39406>\
**Category:** Help & Support\
**Created:** [September 26, 2021, 1:05pm UTC](https://resource.dopus.com/t/how-to-addfile-from-destination-tab-selected-files/39406 "2021-09-26T13:05:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![khalidhosain](https://resource.dopus.com/user_avatar/resource.dopus.com/khalidhosain/32/28729_2.png) [@khalidhosain](https://resource.dopus.com/u/khalidhosain)\
**Post date:** [September 26, 2021, 1:05pm UTC](https://resource.dopus.com/t/how-to-addfile-from-destination-tab-selected-files/39406/1 "2021-09-26T13:05:56Z")

</div>

How to `AddFile ` from Destination Tabs Selected files?  
I want to AddFile from the destination tab. the file I want to add is already selected by this command:

```auto
cmd.RunCommand('Select (coverart|folder).jpg');

```

I have found a temporary solution for that job, but I believe there is a better way for do the same job.

```auto
var FirstFile2 = clickData.func.desttab.selected_files(0);
var FirstFile3 = clickData.func.desttab.selected_files(1);
cmd.AddFile(FirstFile2);
cmd.AddFile(FirstFile3);

```

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [September 26, 2021, 1:56pm UTC](https://resource.dopus.com/t/how-to-addfile-from-destination-tab-selected-files/39406/2 "2021-09-26T13:56:54Z")

</div>

I'm not sure where the question is here. Just take to the path to file you want to add, and add it. Which part are you having problems with? You don't need to select the file first in order to add it.

---

<div class="post-metadata">

**Author:** ![khalidhosain](https://resource.dopus.com/user_avatar/resource.dopus.com/khalidhosain/32/28729_2.png) [@khalidhosain](https://resource.dopus.com/u/khalidhosain)\
**Post date:** [September 26, 2021, 4:34pm UTC](https://resource.dopus.com/t/how-to-addfile-from-destination-tab-selected-files/39406/3 "2021-09-26T16:34:48Z")

</div>

> [@Leo](#):
>
> where the question is here.

I have some files only (not dir) on my Destination file display. How to add those files with `cmd.AddFile();`

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [September 26, 2021, 11:01pm UTC](https://resource.dopus.com/t/how-to-addfile-from-destination-tab-selected-files/39406/4 "2021-09-26T23:01:19Z")

</div>

Call `cmd.AddFile(x)` where `x` is the path to the file you want to add.
