Get Folder Tree selection

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!

Try

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

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!

If you're getting unwanted quotes, try this:

@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:

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

But that depends on how sublime_text.exe behaves.

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

2 Likes

Thank you for your reply!
J!

Thank you lxp my friend!

This is working fine!!!

Thank you a million!

J!