Problems with the command "ifpathR" - for right tab's folder

Hello,
I use Directory Opus Pro 13.9.

I created a button with a simple check.
It should verify whether the right folder tab is an FTP or SFTP folder. Otherwise, the message “This is not FTP SFTP path” should appear.

In my example, the right folder tab is an FTP directory.
The check in the button works as long as the focus is on the right folder tab - I get the message “FTP”.
However, if the focus is on the left folder tab, the button no longer detects the right FTP/SFTP folder tab and immediately jumps to the else branch, giving me the message “This is not FTP SFTP path”.

Shouldn’t ifpathR always work, regardless of where the focus is?
Otherwise, I could just use ifpath.
Is this a bug?

Button Code:

@ifpathR:sftp://*
@confirm:"SFTP" 
@ifpathR:ftp://*
@confirm:"FTP" 
@ifpathR:else
@confirm:"This is not FTP SFTP path"

@ifpathr is for regex.

Command modifier reference

Yes ifpathr is for regex, but ifpathR is for right tab's folder.

https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Other_Status_Bar_Codes.htm

That’s the Opus 12 manual page for Stratus Bar Codes, which are only relevant to the status bar; they aren’t for use in commands.

OK, so what could my query look like?

You can use @if with an Evaluator expression.

@if:= PathType(source)=="ftp" || PathType(dest)=="ftp"
@confirm:At least one side is an FTP path
@if:else
@confirm:Neither side is an FTP path

(Note that there's no separate SFTP path type, at least currently. Both FTP and SFTP are classified as "FTP".)

If you are looking for a reason to upgrade: Opus 13.19.3 and up can handle the job with a one-liner:

=Dialog("r", PathType(is_right ? source : dest) == "ftp" ? "FTP" : "No FTP", "OK")
1 Like

^^^ This guy is a good salesman.

In ‘Drag and Drop’, I have this command:

@if:= PathType(source)=="ftp" || PathType(dest)=="ftp"
Copy
@if:else
Copy MOVE

The problem is that if I accidentally move a file within the same directory, I get an error message saying that the source and destination must be different.

It’s right that moving files within the same folder shouldn’t work. But the error message is annoying.

If the command is written like this, the error message doesn’t appear.

Copy MOVE

Try reversing things, so Copy MOVE is the first command:

@if:= PathType(source)!="ftp" && PathType(dest)!="ftp"
Copy MOVE
@if:else
Copy

That will make it ignore drops on the same folder, but should still result in a copy with FTP paths (although I haven't checked that part; let me know if it doesn't work as expected).

(The tooltip is also based on the first command, so it'll say it's a move if the drag isn't blocked due to being on the same folder.)