I wanted CVS integrated into the finder. I still do. This was a first step for me as I am just learning AppleScript. I created a folder action that will color code the files based on thier CVS status.
I don't know if this is good AppleScript code. I just know it seems to run and work on my machine. If there are any recomendations on, A) better coding practices or, B) a better means for doing CVS work from the Finder, all comments are welcome.
Read the rest of the hint for the script...
[robg adds: I haven't tested this one myself...]
-- set the amount of time before dialogs auto-answer:
property dialog_timeout : 30
property cvs_folder : "CVS"
property added_label : 7 -- Grey
property modified_label : 4 -- Blue
property updates_label : 6 -- green
property conflict_label : 2 --Red
property noncvs_label : 1 -- orange
property no_label : 0
property grey_label : 7 -- Grey
property yellow_label : 3 -- Yellow
property purple_label : 5 -- Purple
on opening folder thisFolder
tell application "Finder"
activate
try
if (exists folder cvs_folder of thisFolder) then
set folderUrl to the URL of thisFolder
set localOffset to offset of "localhost" in folderUrl
set folderPath to text (localOffset + 9) thru end of folderUrl
set cvsResponse to do shell script "cd " & folderPath & ¬
";/usr/bin/cvs -nq update -l"
set thisFileList to list folder thisFolder with invisibles
repeat with thisFile in thisFileList
set fileItem to ((thisFolder as string) & thisFile) as alias
set the label index of the fileItem to no_label
end repeat
set my text item delimiters to return
repeat with cvsLine in text items of cvsResponse
if length of cvsLine is 0 then
exit repeat
end if
set cvsStatus to text 1 thru 1 of cvsLine
set cvsFile to text 3 thru end of cvsLine
if cvsFile is in thisFileList then
set fileItem to ((thisFolder as string) & cvsFile) as alias
if cvsStatus is equal to "C" then
set the label index of the fileItem to conflict_label
else
if cvsStatus is equal to "?" then
set the label index of the fileItem to noncvs_label
else
if cvsStatus is equal to "P" or cvsStatus is equal to ¬
"U" then
set the label index of the fileItem to updates_label
else
if cvsStatus is equal to "M" then
set the label index of the fileItem to modified_label
else
if cvsStatus is equal to "A" then
set the label index of the fileItem to added_label
end if
end if
end if
end if
end if
end if
end repeat
end if
on error e
display dialog e
end try
end tell
end opening folder
Mac OS X Hints
http://hints.macworld.com/article.php?story=20040312161958846