A script to find Dropbox conflicts

May 18, '11 07:30:00AM

Contributed by: nathanator11

Dropbox has become my favorite method of syncing files. The one thing I don't really like about it is how it handles the times when multiple computers report new versions of a file. Dropbox decides to keep both, and adds the words Conflicted Copy and some other info to the filename of the one it's not sure about. I got tired of regularly having to manually hunt for such files, so I wrote a script to do it for me.

This AppleScript uses the find command to find the affected files. It opens Finder windows with each file selected so they're easy to find and deal with. I hope this script is as useful to you as it has been to me.

Paste this into AppleScript Editor and save it as an Application. Run it whenever you want to find conflicted copies.

set conflictedFiles to do shell script "cd ~/Dropbox; find -L . \\( -path \"*.dropbox*\" -prune \\) -o \\( -name \"*conflicted*\" -print \\)"
set fileList to paragraphs of conflictedFiles as list
repeat with currFile in fileList
  set currPath to (path to home folder as string) & "Dropbox" & POSIX file (characters 3 thru -1 of (currFile as string) as string)
  tell application "Finder" to make new Finder window to currPath
end repeat
Note: I've tried a few different versions of the shell script, but this is the one that's been the fastest for me. If you tweak this script and it runs faster, please post in the comments! I'm always eager to see my scripts made better.

[crarko adds: I tested this, and it works as described, as far as I can see.]

Comments (9)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20110516190048915