question about DiffMerge creating new processes on Mac

Support for our DiffMerge utility.

Moderator: SourceGear

Post Reply
Sniffy
Posts: 1
Joined: Fri May 08, 2009 4:27 pm

question about DiffMerge creating new processes on Mac

Post by Sniffy » Fri May 08, 2009 4:32 pm

I'm running DiffMerge 3.3 on a Mac using the diffmerge.sh wrapper script to invoke it. Is there some way to make a new invocation use the existing instance of DiffMerge, instead of creating a new app instance each time? It's a pain to diff 10 files and then have to close 10 instances of DiffMerge, separate windows in 1 instances would be way more convenient.

jeffhostetler
Posts: 534
Joined: Tue Jun 05, 2007 11:37 am
Location: SourceGear
Contact:

Re: question about DiffMerge creating new processes on Mac

Post by jeffhostetler » Mon May 11, 2009 7:21 am

sorry, but no. i don't currently have any code in there to hand the subsequent
files to the first instance.

FWIW, you can use one of the "File | Open..." menu items to open the subsequent
file sets in a new window; these will be kept in the same process.

I'll log a feature request for this.

jeff

item:14334

Mike Smith
Posts: 3
Joined: Fri Jun 19, 2009 4:08 pm

Re: question about DiffMerge creating new processes on Mac

Post by Mike Smith » Fri Jun 19, 2009 4:11 pm

It might make more sense to add some basic AppleScript support to DiffMerge, so that you can use some variation on

tell application "DiffMerge"
compare files "file1" and "file2"
end tell

This will DTRT with regards to opening DiffMerge from scratch v.s. activating an existing instance.

= Mike

jeffhostetler
Posts: 534
Joined: Tue Jun 05, 2007 11:37 am
Location: SourceGear
Contact:

Re: question about DiffMerge creating new processes on Mac

Post by jeffhostetler » Mon Jun 22, 2009 6:54 am

That's an interesting suggestion. I must admit that I'm a bit of an AppleScript novice,
so I'll have to log this and research it. Since DiffMerge runs on Windows, Linux, and
Mac using the same source (wxWidgets rocks), I haven't had much need/opportunity to
dive into a lot of platform-isms, but this is an area that needs work.

In the mean time, can you use the "do shell script" command to launch the
wrapper script that I put on the DMG?
http://developer.apple.com/technotes/tn2002/tn2065.html

I haven't had a chance to try this, but it's worth a try. I put a diffmerge shell
script and a README for installing it in a directory on the DMG.

Hope this helps,
jeff

14498

Mike Smith
Posts: 3
Joined: Fri Jun 19, 2009 4:08 pm

Re: question about DiffMerge creating new processes on Mac

Post by Mike Smith » Fri Jul 31, 2009 4:54 pm

Jeff,

The OP is already invoking the shell script, which is what gets them multiple instances of the app.

My suggestion re: using AppleScript was just to take advantage of the fact that it will either look up an existing instance of the app, or create a new one, before dispatching the "open this" message to it, and that you can invoke that from a shellscript wrapper like the one you currently ship.

= Mike

jeffhostetler
Posts: 534
Joined: Tue Jun 05, 2007 11:37 am
Location: SourceGear
Contact:

Re: question about DiffMerge creating new processes on Mac

Post by jeffhostetler » Mon Aug 03, 2009 8:33 am

Thanks for the update.

Yeah, that sounds like it might just do the trick.
I'll see if I can't make this work.

thanks again,
jeff

Post Reply