-- make-bbedit.txt by Joe Strout -- http://www.strout.net/applescript/ -- drag-and-drop interface on open fileList repeat with aFile in fileList processFile(aFile) end repeat speakResult(count of fileList) end open -- launch interface (assumes launch doesn't disturb finder selection; -- e.g., script may be launched from Automated Tasks menu on run repeat with aFile in application "Finder"'s selection processFile(aFile) end repeat speakResult(count of (application "Finder"'s selection as list)) end run -- process one file on processFile(pFile) set fname to pFile as string tell application "Finder" set file type of file fname to "TEXT" set creator type of file fname to "R*ch" update file fname end tell end processFile -- give feedback (using speech manager when available) on speakResult(pCount) if pCount is 1 then set output to "File fixed." else set output to (pCount as string) & " files fixed." end if try say output -- attempt to speak the output on error -- but if that fails, use a dialog display dialog output end try end speakResult