SIMILAR vs SIMILARBASE confusion

According to help:
SIMILAR

SIMILARBASE

[quote]Selects all files with the same base-names as the currently selected files[/quote], that is, the part of the file name in front of the extension. Though I'm not sure for this one. Does it looks for the first '.' or the last one?)

I have the following files in a directory:

Now, if I have RMD.ahk.bak selected and issue "Select SIMILARBASE" I'd expect RMD.ahk.bak and Standby.ahk.bak to be selected but nothing changes. On the other hand, issuing "Select SIMILAR" selects both files with .bak extensions. To escalate the confusion, having RMD.ahk selected, "Select SIMILARBASE" will select RMD.ahk, RMD.ahk.bak and RMD.exe.
But the last blow comes when I select RMD.ahk.bak, and try SIMILARBASE. It doesn't do anything.

Because it´s supposed to work like this; the "base" of SIMILARBASE ist the name part, which should be the same, with different extensions. Like you have
movie files all with the same name, but various extensions like .avi, .srt, .cue, .inf, whatever.

Because it´s supposed to work like this; the "base" of SIMILARBASE ist the name part, which should be the same, with different extensions. Like you have
movie files all with the same name, but various extensions like .avi, .srt, .cue, .inf, whatever.[/quote]

Ohh, sorry, that was a mistype on my part :slight_smile: And I guess the confusion comes from having multiple '.'s in the filename. The initial selection of RMD.ahk yields the selection of RMD.ahk.bak meaning that it works in RMD.ahk -> RMD.ahk.bak direction. I guess that meant that ("functionally"):
#1

similarbase("RMD.ahk") = similarbase("RMD.ahk.bak") implying that
#2a

similarbase("RMD.ahk") = "RMD"
and necessarily
similarbase("RMD.ahk.bak") = "RMD"

or #2b

similarbase("RMD.ahk") = "RMD.ahk"
and necessarily
similarbase("RMD.ahk.bak") = "RMD.ahk"

But the initial selection of RMD.ahk.bak will not result in selecting RMD.ahk, that is
#3

similarbase("RMD.ahk.bak") != similarbase("RMD.ahk")

And this conflicts with the first statement.

Opus will work out the basename or the extension (depending on which command you run) and then select based on that using a wildcard.

If RMD.ahk.bak is selected then one command will select .bak and the other will select RMD.ahk.

If RMD.ahk is selected then one command will select .ahk and the other will select RMD. (which includes RMD.ahk.*)

I see. Thanks for the clarifications, Leo.