-- SVN_Diff_Droplet -- version 1.0, Rob Probin -- Based on Creation date change by Daniel A. Shockley (http://www.danshockley.com) and -- others, see http://www.macosxhints.com/article.php?story=20060703160750583 -- -- Relies on Subversion command line application and svn-viewdiff2.sh -- on run -- Double click response, let's get a dialog open set dialogMsg to "Choose files or folder of files to SVN diff with the baseline?" set buttonChoices to {"Cancel", "Folder", "Files"} set openChoice to button returned of (display dialog dialogMsg buttons buttonChoices default button "Files") if openChoice is "Files" then set chooseFileDialog to "Choose the file(s) you want to SVN diff:" set fileList to choose file with prompt chooseFileDialog with multiple selections allowed else if openChoice is "Folder" then set oneFolder to choose folder with prompt "Choose the folder whose files you want to SVN diff:" tell application "Finder" set fileList to (files of oneFolder) as alias list end tell end if perform_SVN_diff(fileList) end run on open someItems -- someItems could be files or folders - will only process FILES perform_SVN_diff(someItems) end open on perform_SVN_diff(fileList) -- for now, just handle files, not folders repeat with oneItem in fileList if folder of (info for oneItem without size) is false then set shellCommand to "svn diff " & quoted form of POSIX path of oneItem & " --diff-cmd /usr/local/bin/svn-viewdiff2.sh" --set logMsg to ("Did a Diff of '" & oneItem as string) & "' " --logConsole("SVN_Diff_Droplet", logMsg) -- this line gets this applescript to doing the work do shell script shellCommand -- these three lines get the terminal doing this action --tell application "Terminal" -- do script with command shellCommand --end tell end if end repeat end perform_SVN_diff on idle -- do something, then pause, then do it again, then pause, etc. return 99999 -- pause for lots of seconds, avoid hogging processor end idle on logConsole(processName, consoleMsg) -- version 1.5 - Daniel A. Shockley, http://www.danshockley.com -- 1.5- uses standard date-stamp format set timeStamp to do shell script "date +\"%Y-%m-%d %H:%M:%S\"" set hostName to do shell script "hostname -s" & space set logMsg to (return & timeStamp & space & hostName & space & processName & ":" & space & consoleMsg) set shellCommand to "echo" & space & quoted form of logMsg & " >> /dev/console" do shell script shellCommand end logConsole