VIEWERCMD to select currently viewed file minus extension?

Hello,

Example files:

Video1.mp4
Video1.mp4.jpg

If I'm viewing Video1.mp4.jpg in the Standalone Viewer, what command could I run that would close the viewer and select the Video1.mp4 file?

If this info is needed: My .mp4.jpg files are hidden and I'm using Leo's Viewer Select script.

Try this:Select {file|noext} DESELECTNOMATCH Show VIEWERCMD=close

Thanks for your reply, Kundal.

That didn't seem to work. It just deselects the currently selected file so half that line worked.

That code is the same kind of samples I was testing with. My SetAttr {filepath$|noext} META=rating:0 works great so not sure why the Select {filepath$|noext} command wouldn't work.

...

Wait a minute. That code was working. Now it's not. Maybe something changed or a bug? I'm running 12.3.1...

...

Oh, it only works when the .mp4.jpg file isn't hidden :frowning:

My original post to select the .mp4 from the viewer still doesn't work even with the .jpg's not hidden. So now I have two problems.

The displayed file being hidden shouldn't matter as far as I can tell, as long as the file you want to select is not hidden.

My guess is there are some brackets or other wildcard characters in the filename, confusing things.

Try this:

Select DESELECTNOMATCH SETFOCUS EXACT PATTERN={file|noext} Show VIEWERCMD=close

If that doesn't work, what kind of folder are you in?

Also, how are you launching the viewer? I'm guessing in an unusual way, if you're viewing hidden files, so that may be a factor.

Thanks, Leo.

That code didn't work as-is, but I figured it out. Instead of {file|noext} it works with {allfile|noext}.

Leo's code works better than Kundals. Kundals code didn't work with () in the filename but Leo's does.

It works with or without the .jpg's hidden :thumbsup:

Also figured out my rating problem because of the hint that it wouldn't work with hidden files. Removed that line of code and it fixed that problem.

Thank you both for your time and help!

Are you running that from the viewer toolbar or somewhere else?

Both the Select Movie (select currently viewed file minus extension) and Ratings are buttons on the Standalone Viewer toolbar