Home Versions workflow Comparing differences Custom comparison scripts

Custom comparison scripts

Build your own

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 they want to keep the local changes, and save the final file to the path at the third parameter. This way a user can discard changes they've made if desired.

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.

And use it

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.