# Get Folder Tree selection

**URL:** <https://resource.dopus.com/t/get-folder-tree-selection/36160>\
**Category:** Help & Support\
**Tags:** script\
**Created:** [July 18, 2020, 7:47pm UTC](https://resource.dopus.com/t/get-folder-tree-selection/36160 "2020-07-18T19:47:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![johntor](https://resource.dopus.com/user_avatar/resource.dopus.com/johntor/32/25818_2.png) [@johntor](https://resource.dopus.com/u/johntor)\
**Post date:** [July 18, 2020, 7:47pm UTC](https://resource.dopus.com/t/get-folder-tree-selection/36160/1 "2020-07-18T19:47:01Z")

</div>

I would like to get Folder Tree path when no file/directory is selected in Lister.

I have a button to launch Sublime Text.  
currently I have

> @async:"C:\Program Files\Sublime\sublime\_text.exe" {filepath|noterm}

so if I have a file or directory selected is opened fine.

I would like to improve the script so when nothing is selected to open Folder Tree selected directory.

Thank you in advance!!!

J!

---

<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:** [July 18, 2020, 8:44pm UTC](https://resource.dopus.com/t/get-folder-tree-selection/36160/2 "2020-07-18T20:44:03Z")

</div>

Try

```
@async:"C:\Program Files\Sublime\sublime_text.exe" {sourcepath}{file}
```

---

<div class="post-metadata">

**Author:** ![johntor](https://resource.dopus.com/user_avatar/resource.dopus.com/johntor/32/25818_2.png) [@johntor](https://resource.dopus.com/u/johntor)\
**Post date:** [July 18, 2020, 9:13pm UTC](https://resource.dopus.com/t/get-folder-tree-selection/36160/3 "2020-07-18T21:13:33Z")

</div>

Thank you for your reply...  
It is not working...  
if I use {sourcepath} without 'noterm' then it gets an extra " at the end of the path and Sublime is not working.  
If I put 'noterm' is not working for selected files or dirs on lister!

Thanks again!  
J!

---

<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:** [July 18, 2020, 9:17pm UTC](https://resource.dopus.com/t/get-folder-tree-selection/36160/4 "2020-07-18T21:17:16Z")

</div>

If you're getting unwanted quotes, try this:

```nohighlight
@nofilenamequoting
@async:"C:\Program Files\Sublime\sublime_text.exe" "{sourcepath}{file}"

```

If that still doesn't work, sublime\_text.exe may not like having a \ at the end of the path, or before a " character. (The latter is quite common as it's a bug in how the standard command-line parsing from the Microsoft C runtime works.) If that's the case, and you want it to work with both files selected and nothing selected, then you might need to using scripting so that you can generate different command lines in both situations.

You may also find that this works:

```nohighlight
cd {sourcepath}
@async:"C:\Program Files\Sublime\sublime_text.exe" {file}

```

But that depends on how sublime\_text.exe behaves.

---

<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:** [July 18, 2020, 9:45pm UTC](https://resource.dopus.com/t/get-folder-tree-selection/36160/5 "2020-07-18T21:45:53Z")

</div>

Using `"%V"` instead of `{sourcepath}{file}` might do the trick.

---

<div class="post-metadata">

**Author:** ![johntor](https://resource.dopus.com/user_avatar/resource.dopus.com/johntor/32/25818_2.png) [@johntor](https://resource.dopus.com/u/johntor)\
**Post date:** [July 18, 2020, 9:52pm UTC](https://resource.dopus.com/t/get-folder-tree-selection/36160/6 "2020-07-18T21:52:58Z")

</div>

> [@Leo](#):
>
> Both not working!  
> The first (@nofilenamequoting)  
> has problems with spaces inside the paths...
> 
> The second no solution to the folder tree selection

Thank you for your reply!  
J!

---

<div class="post-metadata">

**Author:** ![johntor](https://resource.dopus.com/user_avatar/resource.dopus.com/johntor/32/25818_2.png) [@johntor](https://resource.dopus.com/u/johntor)\
**Post date:** [July 18, 2020, 9:56pm UTC](https://resource.dopus.com/t/get-folder-tree-selection/36160/7 "2020-07-18T21:56:17Z")

</div>

Thank you lxp my friend!

This is working fine!!!

Thank you a million!

J!
