I have bodged this script together from various bits I have found. But due to my limited knowledge I don’t know how to save the files as Illustrator CS2, I can only manage to get CS2 eps files. Can anyone help out?
set theFolder to choose folder with prompt "Choose folder containing Adobe CS4 files"
set targetFolder to choose folder with prompt "Location for CS2 files"
set targetPath to (targetFolder as Unicode text)
tell application "Finder"
open files of theFolder
end tell
tell application "Adobe Illustrator"
-- Turn off user interaction so dialogs don't cause the script to get stuck
set user interaction level to never interact
-- Count the open documents
set documentCount to count documents
-- Export each open document
repeat with i from 1 to documentCount
-- Perform the save
save document i in file (targetPath) with options {class:EPS save options, compatibility:Illustrator 12}
end repeat
end tell
tell application "Adobe Illustrator"
-- Turn off user interaction so dialogs don't cause the script to get stuck
set user interaction level to never interact
-- Count the open documents
set documentCount to count documents
-- Export each open document
repeat with i from 1 to documentCount
-- Close all documents
close current document saving no
end repeat
end tell