The first page of this section has already accumulated several requests for help that have not received any response. There are many generous, experienced users willing to help, but when the information is insufficient, the question is vague, or too extensive, your request remains unanswered.
I uninstalled Adobe Illustrator, and I can’t help you, but others who have it installed will help you if you explain what the dwg and millimeters variables in your snippet are. And please, always use the “Applescript” formatter button of site for code snippets:
save theDocument in file fileName as dwg with options {millimeters}
Note: Most likely, the error message tells you that there is no millimeters option known to Illustrator. It should be like this: {ruler units: millimeters}, as I read from Illustrator scripting documentation.
You say DXF/DWG is the auto cad export option, but you use save command. Try the export command instead.
set destinationFolder to choose folder
set destinationPath to destinationFolder as string
set newFilePath to destinationPath & "Sample.dxf"
tell application "Adobe Illustrator"
export current document to newFilePath as AutoCAD with options ¬
{class:AutoCAD export options, export file format:dxf, scal unit:autocad millimeters}
end tell
I am sorry. At this moment I have not Illustrator to help you with details like this. I will try, but any help from other users would be very appropriate now.