My script is working nice until I try to export my document. I am trying to export my document as a DXF file. Using the Illustrator CS6 Scripting Reference I am using the TIFF export as a reference as there are no examples for exporting as a DXF (my luck!). This is what I have in VBscript. With this script I get the following error on the second to last line:
"Illegal argument - argument 2 - Enumerated value expected"
As you can see I do have one: "0" so I suspect the error lies elsewhere in the code? I'll take a JavaScript example if you are not into VBscript since the two look very similar and I think I can adapt it.
Set App = CreateObject("Illustrator.Application")
Set FSO = CreateObject("Scripting.FileSystemObject")
Dim dest
dest = "S:\SOCAL\Section_32\Veg DXFs LC\SOCAL_CK67_pineLC"
Set DXFexport = CreateObject("Illustrator.ExportOptionsAutoCAD")
If App.Documents.Count > 0 Then
Set docRef = App.ActiveDocument
Call docRef.Export (dest, 0, DXFexport) ' 0 = aiDXF
End If