FOLDERCONTENT: Just show file in lister, not open it

Button with two modes, first should open the file, the second just show (mark) it in the lister. Doesn't work:

@keydown:none
Go "PATH" FOLDERCONTENT="nodirs filefilter=.txt"
@keydown:shift
"PATH" FOLDERCONTENT="nodirs filefilter=
.txt"

You can't use @keydown around commands which generate a list of buttons.

Not happy, so I must use two buttons. But only open works with
Go "PATH" FOLDERCONTENT="nodirs filefilter=.txt"
So is there any way to just show the file in lister?

What does "show the file in the lister" mean?

"PATH" FOLDERCONTENT="nodirs filefilter=.txt" is not a valid command so its hard to know what it is you're trying to do.

Try this command:

Go "your path" FOLDERCONTENT="nodirs,filefilter=*.txt"
[
@keydown:none
FileType ACTION=open
// or FileType ACTION=dblclk
@keydown:shift
Go OPENCONTAINER
]

Click to open file.
Hold Shift and click to show file in the lister.

2 Likes

Many thanks, but doesn't work.

Using a crystal ball to figure out what the OP meant, this should work (if the list depends on the source tab):

Go {sourcepath$} FOLDERCONTENT="nodirs,filefilter=*.txt"
[
@keydown:none
{$targetpath}
@keydown:shift
Go "{$targetpath}" OPENCONTAINER
]

From the list, a normal click opens the file. With shift, it locates it in the file display.

(Jon how can you access to {$targetpath} via Evaluator?)

1 Like

In the evaluator context, selpath seems equivalent to {$targetpath}

I found it, it's just $targetpath (same rules as other variables apply).
But the instructions above will still work, assuming that's what the OP was referring to.

$targetpath exists in the context of FOLDERCONTENT and resolves to the chosen entry.
selpath is an Evaluator variable that resolves to the full path of the selected item (in the source file display).

1 Like

Good.

Yes, I know that. But the value of selpath in the embedded command is indeed the same as ${targetpath}, it’s not the path of the selected item in the source file display.

Anyway, using $targetpath is better :grinning_face:

True!

In fact, if you use something like =Output($targetpath), you'll see it gets called twice, once with an empty value, and then again with the actual value. That doesn't happen with selpath.

1 Like

Sorry for any confusion.

I want to use an button, displaying files via FOLDERCONTENT, with two modes:

  1. Open the selected file when no modifier key is pressed.
    In cases without FOLDERCONTENT (single file), only the full file name is used without Go as function.
  2. Show/mark the selected file in the lister when modifier key shift is pressed.
    In cases without FOLDERCONTENT (single file), Go is used before the full file name as function.

My problem is the second case in the context of FOLDERCONTENT. I can use two parent buttons (Open, Show/mark) to avoid using the modifier key - but I can't figure out the command for show/mark the file with FOLDERCONTENT!

Many thanks for all your efforts
opusfreak

Files from where? A fixed path? The source path? That's the important part you didn't mention.

Did you try my response above? Because if by "mark" you mean "select", I think that's exactly what the function is doing (you might see slight differences in virtual folders though).

The path is fixed. Just a normal folder. Show/mark = select.

Go "your path" FOLDERCONTENT="nodirs,filefilter=*.txt"
[
@keydown:none
{$targetpath}
@keydown:shift
Go "{$targetpath}" NEWTAB=findexisting OPENCONTAINER
]

You can start from there, make sure to read the GO command page from the manual.