# Open folder in existing layout

**URL:** <https://resource.dopus.com/t/open-folder-in-existing-layout/58062>\
**Category:** Help & Support\
**Created:** [December 15, 2025, 8:14am UTC](https://resource.dopus.com/t/open-folder-in-existing-layout/58062 "2025-12-15T08:14:40Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![skinz](https://resource.dopus.com/user_avatar/resource.dopus.com/skinz/32/42589_2.png) [@skinz](https://resource.dopus.com/u/skinz)\
**Post date:** [December 15, 2025, 8:14am UTC](https://resource.dopus.com/t/open-folder-in-existing-layout/58062/1 "2025-12-15T08:14:40Z")

</div>

I have a button command to open a folder container in a specific layout like this:

`Go FROMSEL LAYOUT=Container_layout`

The problem is that every time I press the button, it opens a new layout, and I end up with multiple layouts open. Is there a command like `findexisting` for layouts? What I want is a command that can open folders in only one existing layout. Any help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [December 15, 2025, 8:24am UTC](https://resource.dopus.com/t/open-folder-in-existing-layout/58062/2 "2025-12-15T08:24:12Z")

</div>

Try

```plaintext
Prefs LAYOUT=Container_layout LAYOUTTHISLISTER
Go FROMSEL

```

---

<div class="post-metadata">

**Author:** ![skinz](https://resource.dopus.com/user_avatar/resource.dopus.com/skinz/32/42589_2.png) [@skinz](https://resource.dopus.com/u/skinz)\
**Post date:** [December 15, 2025, 8:38am UTC](https://resource.dopus.com/t/open-folder-in-existing-layout/58062/3 "2025-12-15T08:38:27Z")

</div>

Thanks @lxp, but that command replaces my main or default layout. What I want is for me to select a folder in my main lister (default lister) and press a key, then the command will open the folder in the new layout (Container\_Layout) if it doesn't already exist, but keep my default layout. However, if Container\_Layout already exists, then the folder will open in the same layout (Container\_Layout). I hope my explanation is clear enough.

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [December 15, 2025, 8:56am UTC](https://resource.dopus.com/t/open-folder-in-existing-layout/58062/4 "2025-12-15T08:56:36Z")

</div>

> [@skinz](#):
>
> I hope my explanation is clear enough.

I am struggling a bit, I have to admit 😊

You only want to apply the layout to listers that were launched with a different layout - to prevent undoing changes, I presume?

---

<div class="post-metadata">

**Author:** ![skinz](https://resource.dopus.com/user_avatar/resource.dopus.com/skinz/32/42589_2.png) [@skinz](https://resource.dopus.com/u/skinz)\
**Post date:** [December 15, 2025, 8:57am UTC](https://resource.dopus.com/t/open-folder-in-existing-layout/58062/5 "2025-12-15T08:57:45Z")

</div>

I hope this command works:

`Go FROMSEL LAYOUT=Container_layout, findexisting`

`findexisting` works for tabs but not for layouts, or maybe I'm missing something.

---

<div class="post-metadata">

**Author:** ![skinz](https://resource.dopus.com/user_avatar/resource.dopus.com/skinz/32/42589_2.png) [@skinz](https://resource.dopus.com/u/skinz)\
**Post date:** [December 15, 2025, 9:04am UTC](https://resource.dopus.com/t/open-folder-in-existing-layout/58062/6 "2025-12-15T09:04:31Z")

</div>

> [@lxp](#):
>
> You only want to apply the layout to listers that were launched with a different layout - to prevent undoing changes, I presume?

Yes, I also have a bit of difficulty explaining it... 😁

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [December 15, 2025, 9:18am UTC](https://resource.dopus.com/t/open-folder-in-existing-layout/58062/7 "2025-12-15T09:18:33Z")

</div>

Try this script.

```javascript
// https://resource.dopus.com/t/open-folder-in-existing-layout/58062/5

function OnClick(clickData) {
    var cmd = clickData.func.command;
    var tab = clickData.func.sourcetab;

    var newLayout = 'Container_layout';

    if (tab.lister.layout != newLayout) {
        cmd.RunCommand('Prefs LAYOUT="' + newLayout + '" LAYOUTTHISLISTER');
    }
    cmd.RunCommand('Go FROMSEL');
}

```

---

<div class="post-metadata">

**Author:** ![skinz](https://resource.dopus.com/user_avatar/resource.dopus.com/skinz/32/42589_2.png) [@skinz](https://resource.dopus.com/u/skinz)\
**Post date:** [December 15, 2025, 9:28am UTC](https://resource.dopus.com/t/open-folder-in-existing-layout/58062/8 "2025-12-15T09:28:14Z")

</div>

Thanks @lxp, but the script still replaces my default lister with Container\_layout instead of keeping my default lister and opening a new "Container\_layout".

---

<div class="post-metadata">

**Author:** ![skinz](https://resource.dopus.com/user_avatar/resource.dopus.com/skinz/32/42589_2.png) [@skinz](https://resource.dopus.com/u/skinz)\
**Post date:** [December 15, 2025, 9:29am UTC](https://resource.dopus.com/t/open-folder-in-existing-layout/58062/9 "2025-12-15T09:29:46Z")

</div>

Maybe I have another way to explain it... hopefully it works.  
Essentially, I just want to select a folder in my default lister and then press the key command:

Go FROMSEL LAYOUT=Container\_layout

and that command will open the selected folder in the NEW layout "Container\_layout" without replacing my default layout/lister. Up to this point, this command works perfectly.

But the problem arises when I select another folder in my default lister and press the key command again, it opens another new layout "Container\_layout", so now I have two "Container\_layouts" open.

What I want is for the command to try to find an existing "Container\_layout" first instead of opening a new one. What I want is for it to use only one "Container\_layout" when I press the key command.

 ![2025-12-15_163810](https://resource.dopus.com/uploads/default/original/3X/5/8/58ce348ecdf2a5bb166c80f108411bb018c2e68e.png)

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [December 15, 2025, 9:50am UTC](https://resource.dopus.com/t/open-folder-in-existing-layout/58062/10 "2025-12-15T09:50:01Z")

</div>

I think I know what you mean 🙂

Try

```javascript
// https://resource.dopus.com/t/open-folder-in-existing-layout/58062/9

function OnClick(clickData) {
    var cmd = clickData.func.command;

    var targetLayout = 'Container_layout';

    var targetLister = FindListerByLayout(targetLayout);

    if (targetLister) {
        cmd.SetSourceTab(targetLister.activetab);
        cmd.RunCommand('Go FROMSEL TOFRONT');
    } else {
        cmd.RunCommand('Go FROMSEL LAYOUT="' + targetLayout + '"');
    }
}

function FindListerByLayout(layoutName) {
    for (var e = new Enumerator(DOpus.listers); !e.atEnd(); e.moveNext()) {
        var lister = e.item();
        if (lister.layout == layoutName) {
            return lister;
        }
    }
    return null;
}

```

---

<div class="post-metadata">

**Author:** ![skinz](https://resource.dopus.com/user_avatar/resource.dopus.com/skinz/32/42589_2.png) [@skinz](https://resource.dopus.com/u/skinz)\
**Post date:** [December 15, 2025, 9:58am UTC](https://resource.dopus.com/t/open-folder-in-existing-layout/58062/11 "2025-12-15T09:58:33Z")

</div>

> [@lxp](#):
>
> I think I know what you mean 🙂
> 
> Try
> 
> ```auto
> // https://resource.dopus.com/t/open-folder-in-existing-layout/58062/9
> 
> function OnClick(clickData) {
> var cmd = clickData.func.command;
> 
> var targetLayout = 'Container_layout';
> 
> var targetLister = FindListerByLayout(targetLayout);
> 
> if (targetLister) {
> cmd.SetSourceTab(targetLister.activetab);
> cmd.RunCommand('Go FROMSEL TOFRONT');
> } else {
> cmd.RunCommand('Go FROMSEL LAYOUT="' + targetLayout + '"');
> }
> }
> 
> function FindListerByLayout(layoutName) {
> for (var e = new Enumerator(DOpus.listers); !e.atEnd(); e.moveNext()) {
> var lister = e.item();
> if (lister.layout == layoutName) {
> return lister;
> }
> }
> return null;
> }
> 
> ```

Ah, finally it worked. I thought it would just need a simple command line, but it turns out it requires a script. Thanks again @lxp for your help, it was very helpful and I appreciate it.

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [December 15, 2025, 10:29am UTC](https://resource.dopus.com/t/open-folder-in-existing-layout/58062/12 "2025-12-15T10:29:18Z")

</div>

Yeah, once you start juggling listers, scripting becomes inevitable 😃

---

<div class="post-metadata">

**Author:** ![skinz](https://resource.dopus.com/user_avatar/resource.dopus.com/skinz/32/42589_2.png) [@skinz](https://resource.dopus.com/u/skinz)\
**Post date:** [December 15, 2025, 11:36am UTC](https://resource.dopus.com/t/open-folder-in-existing-layout/58062/13 "2025-12-15T11:36:30Z")

</div>

Some of you might be curious about my request above, which is to replicate what's available in OneCommander. If you have a long catalog, such as a texture catalog, you can view them side-by-side in OneCommander. On the left side, you'll see a list of your catalogs, and on the other side, you'll see the contents of the selected folder as thumbnails.

 ![2025-12-15_171950](https://resource.dopus.com/uploads/default/original/3X/2/c/2c28dd40709b71d2dbb01fd0cdbc618d28710605.jpeg)

You can do this in Dopus with a simple command line command, `go openindual` If you want to see the contents of the folder in the destination tab.

 ![2025-12-15_175818](https://resource.dopus.com/uploads/default/original/3X/0/e/0e34cd49a3bd7ab850a04df65afafb7a86470f56.png)

Or you can use the [script](https://resource.dopus.com/t/open-folder-in-existing-layout/58062/10) above from @lxp if you want to see the content in a specific layout.

 ![2025-12-15_171322](https://resource.dopus.com/uploads/default/original/3X/b/6/b608682b47ccdc606073b0907309be23142bdac8.jpeg)

Personally I prefer to use Dopus for things like this because Dopus has more features, one of which is in Dopus you can enlarge the image to see the details just by clicking and holding the image in the viewer pane and it is very, very useful.

Or you can use another script from @dasota to see the contents of the folder.  
[Info Bar](https://resource.dopus.com/t/info-bar/56679/1)

Hope this is helpful.

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [December 15, 2025, 12:00pm UTC](https://resource.dopus.com/t/open-folder-in-existing-layout/58062/14 "2025-12-15T12:00:16Z")

</div>

I usually don't mind having a gazillion listers open, but there's definitely something charming about reusing them. Updating an existing lister causes far less visual distraction than drawing a new one.

So yes, perhaps there should be a flag like `useexisting` for `LAYOUT` in **Prefs** and **Go**.

---

<div class="post-metadata">

**Author:** ![skinz](https://resource.dopus.com/user_avatar/resource.dopus.com/skinz/32/42589_2.png) [@skinz](https://resource.dopus.com/u/skinz)\
**Post date:** [December 15, 2025, 1:16pm UTC](https://resource.dopus.com/t/open-folder-in-existing-layout/58062/15 "2025-12-15T13:16:58Z")

</div>

> [@lxp](#):
>
> I usually don't mind having a gazillion listers open

I'm the opposite of this one.... 😅

Another reason I insist on opening it with the same layout is because I use format locking for "Container\_layout" and I can open any folder with a different format but it always displays the same format in "Container\_layout". If I open another folder with a new layout, not the existing one, the format locking will be lost and I have to reapply the format locking.
