display dialog "Open and Save As EPS files in Illustrator CS5" buttons "" giving up after 2
set sourceFolder to choose folder with prompt "Choose an input folder."
set folderName to name of (info for sourceFolder)
set targetPath to sourceFolder as string
tell application "Finder" to set theFiles to files of folder sourceFolder whose name extension is in {"eps", "ai"} or kind contains "Postscript" or kind contains "EPS" or kind contains "Illustrator"
repeat with oneFile in theFiles
tell application "Adobe Illustrator"
activate
set fName to name of oneFile
set savePath to sourceFolder & fName
open (oneFile as alias)
tell front document
save as eps in sourceFolder
close saving no
end tell
end tell
end repeat
tell application "Finder"
activate
display dialog "Done" buttons "" giving up after 3
end tell