If your favorite comparison application is not listed in the Requirements section, or if you want to use different applications for different types of files, or maybe even pre-process some files before you compare them, you can make your own comparison script. The script will be called with 2 or more parameters. If it has 2 parameters, the two files should be compared.
If a third parameter is passed and it's not empty, the script can save a file with the merged changes of the first parameters to the path at the third parameter. For instance, when comparing the local changes of a working copy file, the third parameter will be the same as the second parameter. A compare tool can then ask the user if it wants to keep al the local changes, and save the final file to the path at the third parameter. This way a user can discard made changes if he or she wishes to do so.
Custom compare scripts may be called with more than 3 parameters in the future. Writers of custom compare scripts should make sure they only use the first three parameters for now.
First make sure to create a Compare Scripts folder in the following location ~/Library/Application Support/Versions/ (~ refers to your Home folder). Then copy your script to that newly created folder and it will show up as an option in the “File Comparison:” popup menu in the “Preferences” window. Download the example script.