Help needed in selecting a file

Hello,
I am stuck with something I cant find a solution.

I am doing a duplicate search, find a duplicate file, select it and click on a button. This button should open a new tab, the original selected file should still be selected/or somehow re-selected and it should be placed at the top of the window, first file so to speak.

I have this button working so far:

Clipboard COPYNAMES=nopaths
Go NEWTAB TABPOS=+1
Set VIEW=Thumbnails

but I am stuck with the rest: how can I re-select a file from a clipboard contend and what is the code to show this file as "first file" in list?

Any help is very much apprichiated.

Thanks in advance !

By "first file in the list" I assume you want to scroll the lister to show the file, am I correct?

You can restore a selection with SelectEx (a script command: Command: SelectEx (extended Select command)).
The command line is:

SelectEx EXACT FROMCLIP MAKEVISIBLE

Hey tbone,

WOWOWOWOWWOWOWOW.....GREAT Script, coooooool.

Did copy the button
copy/pasted the " Command.Generic_SelectEx.js.txt"
inserted the line "SelectEx EXACT FROMCLIP MAKEVISIBLE"

it worked righ away !

I think this somehow should be implemented into DO for the next update. This is sooooo usefull. I like the "Scroll to selection" !!!!!!!!!

THANKS A LOT FOR THIS SCRIPT !!!

Thanks, glad it works for you! o)

Notice that SelectEx is in many parts just glue for already existing features and ideas from others.

You can do all of this with a single built-in command, with the bonus that it doesn't trash what's in your clipboard:

Go OPENCONTAINER NEWTAB=findexisting VIEW=thumbnails

Thanks Leo,

yes, I cheked this line and it works too!

@dpfan
So, what is the final button code you use now?

@tbone

yours, since I have already installed it.
Also, there are much more options I´d like to take a look to.
Not understanding all of what they do yet.

@tbone
are you monitoring the german forum too? I see your location is Germany, hint!, lol

Huh? o) Shouldn't it be a combination of what Leo and I suggested and what you already had?

Something like this (but after trying I see, it does not work, it does not open a new tab for me).

Clipboard COPYNAMES=nopaths Go OPENCONTAINER NEWTAB=findexisting VIEW=thumbnails SelectEx EXACT FROMCLIP MAKEVISIBLE
This does, though I actually don't understand why.
I would expect the SelectEx command to act on the old tab, instead of selecting nicely within the new one.

Clipboard COPYNAMES=nopaths Go NEWTAB TABPOS=+1 Set VIEW=Thumbnails SelectEx EXACT FROMCLIP MAKEVISIBLE

My one-line command will select the file and make it visible on its own. No need to combine it with anything (unless you also want the path in the clipboard, of course).

Ok, now I think I understand how it's supposed to work.
This is basically the same behaviour as pasting a path from a file into the path-bar, right?

But for some reason it does not work here, none of these work for a selected file:
Can you think of why that is?
Go OPENCONTAINER NEWTAB=findexisting VIEW=thumbnails
Go OPENCONTAINER NEWTAB VIEW=thumbnails
Go OPENCONTAINER VIEW=thumbnails

Yeah.

[quote]But for some reason it does not work here, none of these work for a selected file:
Can you think of why that is?
Go OPENCONTAINER NEWTAB=findexisting VIEW=thumbnails
Go OPENCONTAINER NEWTAB VIEW=thumbnails
Go OPENCONTAINER VIEW=thumbnails[/quote]
Hmm, I have Preferences / Miscellaneous / Advanced: open_container_in_tabs set to True. Only setting that I can think of.

It's possible your script(s) that run on folder change are cancelling it, maybe? Worth a try disabling them to see if it's that.

There may also be a timeout where the folder taking a long time to read/sort/etc. could cancel the selection. (Not sure about that, but if it's taking more than a couple of seconds to load, might be wroth trying with a smaller folder in case it is that.)

I tried enabling that advanced setting you have enabled, it does not make a difference, the GO commands do nothing here despite deselecting the file.
I also cannot see any script kicking in. I did not empty my scripts folder beforehand though, as I had strange results the last time I did (messed up script-configs and zombie-columns). The folder taking too long to read can be excluded I guess, the locations I tested with were not very populated with items.

I think it's an interesting approach to keep a selection and get a different view on it, especially since it does not rely on several commands and a lot of scripting involved.
It's probably noticeably faster as well, a pitty it won't do here! o)

Thank you for your thoughts on this.