Calling an external Application with two selected files

Hi,

I really searched through the forum but wasn't able to find a solution...

I want to call a DifferenceViewer to compare two files selected in a lister.

I had i working using {filepath} {filepathdest} to compare two files in two different listers (one being the source, one being the destination lister). Now I want the same functionality but with two files selected in ONE liest.

using "...blabla.exe %1 %2" it seems like blabla.exe is called twice. One time with the first selected file as param1 and param2, and the second time with the second selected file as param1 and param2...

I need: "...blabla.exe FirstSelectedFile SecondSelectedFile"

Any idea?

My Diff/Merge toolbar does this on the SvS (source vs source) buttons.

Well, sort of. :slight_smile: It sends the list of all selected files to the program. So if you have two selected files then it will do what you want. If you have one or three/four/etc. files selected then the other program will get confused, of course, but since it doesn't make sense to do that it isn't really a problem.

I don't know if you have a specific "DifferenceViewer" viewer in mind or not, but in addition to Opus I use ExamDiff to compare files and it lets you compare files from anywhere. Just select one in Opus (or Explorer), right click, and set it to be the first file. Then select the other file anywhere else, right click, and send that to ExamDiff to do the comparison.

http://www.prestosoft.com/ps.asp?page=edp_examdiffpro

[quote="leo"]My Diff/Merge toolbar does this on the SvS (source vs source) buttons.

Well, sort of. :slight_smile: It sends the list of all selected files to the program. [/quote]

That was what I was trying not to do... I thought there was a another way to access specifically the first, the second, ... selected file...

But that's ok for now, it works...

thanks!

For Beyond Compare I use the following

<?xml version="1.0"?>
<button backcol="none" display="icon" separate="yes" textcol="none" type="three_button">
	<label>Compare</label>
	<icon1>C:\Program Files\Beyond Compare 2\BC2.exe,0</icon1>
	<button backcol="none" display="icon" hotkey="f9" textcol="none">
		<label>Beyond Compare</label>
		<tip>Compare files/folders with Beyond Compare</tip>
		<icon1>C:\Program Files\Beyond Compare 2\BC2.exe,0</icon1>
		<function type="normal">
			<instruction>C:\Program Files\Beyond Compare 2\BC2.exe {allfilepath} </instruction>
		</function>
	</button>
	<button backcol="none" display="icon" hotkey="shift+f9" textcol="none">
		<label>Compare</label>
		<tip>Compare file/folder selected in left and right pane</tip>
		<icon1>C:\Program Files\Beyond Compare 2\BC2.exe,0</icon1>
		<function type="normal">
			<instruction>@nodeselect</instruction>
			<instruction>C:\Program Files\Beyond Compare 2\BC2.exe {fd} {f}</instruction>
		</function>
	</button>
</button>

OMG! Thanks so much for writing this code! It's the closest thing to integration between Directory Opus and Beyond Compare! Wow! It's clean and it works!

Now...I hope Beyond Compare 3...which comes out next month doesn't break this code. Hopefully only updating it won't ruin this integration. Can you run this code with Beyond Compare 3's beta release yet? The code to the Beyond Compare 3 beta goes Gold after June 30th. It's already out and it's scheduled for a general release in July. Thanks.

You could even define a middle mouse button command which compares the currently opened source and destination folder. This way you don't have to go up to compare two already opened folders.
Beside this i don't see, why this should not work with Beyond Compare 3. You can replace Beyond Compare with any other diff viewer which can take arguments by command line as long as it doesn't need special options. This button works since the Beyond Compare Version 1. Also i have the same button working for WinMerge http://winmerge.org/ with no other modification than the path to the exe.

[code]

<?xml version="1.0"?> Compare C:\Program Files\Beyond Compare 2\BC2.exe,0 Beyond Compare Compare files/folders with Beyond Compare C:\Program Files\Beyond Compare 2\BC2.exe,0 C:\Program Files\Beyond Compare 2\BC2.exe {allfilepath} Compare Compare file/folder selected in left and right pane C:\Program Files\Beyond Compare 2\BC2.exe,0 @nodeselect C:\Program Files\Beyond Compare 2\BC2.exe {fd} {f} Compare Compare current source to destination folder C:\Program Files\Beyond Compare 2\BC2.exe,0 @nodeselect C:\Program Files\Beyond Compare 2\BC2.exe {sourcepath} {destpath} [/code][url][/url][url][/url]

Buttons for doing that were already in my Diff/Merge toolbar, FWIW.

Sorry, didn't know that. I never looked at your toolbar because my solution always fitted my needs.