Convert from CS4 to CS2

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

hi

try changing this line:

save document i in file (targetPath) with options {class:EPS save options, compatibility:Illustrator 12}

to this:

save document i in file (targetPath) as Illustrator with options {class:Illustrator save options, compatibility:Illustrator 12}

Great stuff, thats the line I was looking for. Thanks!

As usual there is always more to add, does anyone know if I can get Illustrator to ignore missing links when opening these files?