GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Compare files (visually) and Set raw command


I would like to visually compare the content of two files. Since I cannot find an internal function for this in DOpus I have to reside to a 3rd party tool for this.
I call this with two arguments: {allfilepath$} {allfilepathdest$} from dual view mode. This sometimes is very confusing since the left side and right side don't always match with the tool because sometimes source is left, sometimes it's right. I tried to fix this with calling Set FOCUS=Left before lauching the compare tool, which seems to work, but I'm affraid the {allfilepath$} {allfilepathdest$} arguments are initialized before this..
Any suggestions to ensure the file I see on the left in DOpus is on the left in the 3rd party tool?

I don't think there's any way around this at the moment. I got used to clicking the left side before clicking the button.

Hmm, actually, you may be able to do it via running Set FOCUS=Left and then running a user command which runs the diffing tool. I suspect (but have not confirmed) that the user command's arguments will be evaluated just before it runs, after the focus has been set.

Even if that works, though, it means the command is in two places which isn't ideal, unless you only have one diff tool. (I've got about 4 diff tools all with Opus buttons, as you can see in my diff toolbar, since all of them have their strengths and serious weaknesses. :frowning: )

By the way, you probably don't want to be using allfilepath in either of your arguments. That would include multiple files on the command line if more than one file was selected in either side.

Also, for when comparing two directories (rather than files) you can use {leftpath} and {rightpath} so that the paths are always the same way around. Unfortunately there isn't the same thing for selected files.

Thanks for your suggestions.
I am currently using arguments "{leftpath}{file$} {rightpath}{file$}" which works fine in most situations, but the files have to have the same file name for this to work.
A {leftfilepath} and {rightfilepath} would certainly help here :wink: