Compatibility is represented as an enumeration defined in the Illustrator dictionary, not a string. You are trying to use "Illustrator 14"
to represent the compatibility version. What you need is Illustrator 14
. Notice the lack of quotes. You can use the following sub-routine to convert a string to an enumeration on the fly. Of course, you can change the string representations if you want. These are just the ones I use.
set CompatibilityType to my convertIllustratorVersion("CS4")
save theCurrentFile in file WorkPath as Illustrator ¬
with options {class:Illustrator save options ¬
, compatibility:CompatibilityType ¬
, embed linked files:true ¬
, font subset threshold:0.0}
on convertIllustratorVersion(originalVersion)
using terms from application "Adobe Illustrator"
set versions to {"CS", "CS2", "CS3", "CS4", "CS5"}
set enums to {Illustrator 11, Illustrator 12, Illustrator 13, Illustrator 14, Illustrator 15}
end using terms from
repeat with i from 1 to (count versions)
if originalVersion is item i of versions then
return item i of enums
end if
end repeat
error (quoted form of originalVersion & " is not a valid Illustrator version")
end convertVersionNumber