Button to copy depends on path

I want to make a button that copy file depends on path.

For example - if I'm on ftp://ftp.something.com/ - i want to copy selected files to Z:
and if I'm on Z:\ - I want to copy to ftp://ftp.something.com/

What is easiest way to do that?

@ifpath or @ifpathr are probably the easiest ways to do that: Command Modifier Reference](https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Command_modifier_reference.htm).

For the FTP paths, try a wildcard like @ifpath:ftp://*@ftp.something.com/* will match the whole site, including the top level. (This is because the internal representation of FTP paths has the username & password at the start, and always at least one "/" after the site name, even when in the root.)

The the drive letter, @ifpath:Z:\* will match both the root and anything below it, since there's always a "" after the drive letter.

If you were doing things relative to child folders, it would need a slightly more complicated wildcard to match both the folder itself (no "" or "/" on the end) and things below the folder. e.g. @ifpath:Z:\child(|\*) would match Z:\child as well as subfolders. (Or you could use @ifpath:Z:\child* but that would also match things like Z:\childnot.)

Ifpath + ifpath:else do everything I want. It's only small moving from ram to remote computer ram, so only root is needed.