help with applescript running export script please
I have an applescript that I'm using to open a DPF in AI2017 and then running the ExportAsDWG script (copied from the Scripting/Sample Scripts folder). File opens and then Applescript bounces a message
Script Error
Adobe Illustrator got an error: Illegal argument - argument 2
- Required value is missing
Result
error "Adobe Illustrator got an error: Illegal argument - argument 2
- Required value is missing" number 1243
Is the related to the export as options possibly?
Any help appreciated!
Here is the modified ExportAsDWG script
var docRef = app.documents.add();
var groupItems = docRef.groupItems;
var groupRef = groupItems.add();
var pathItems = groupRef.pathItems;
// Save document as AutoCAD DWG file.
var destFolder = Folder.selectDialog('Select the folder to export the AutoCAD(DWG/DXF) file to:');
if (destFolder) {
exportAutoCADOptions.exportFileFormat = AutoCADExportFileFormat.DXF;
exportAutoCADOptions.exportOption = AutoCADExportOption.MaximumEditability;
exportAutoCADOptions.version = AutoCADCompatibility.AutoCADRelease18;
docRef.exportFile(destFile, ExportType.AUTOCAD, exportAutoCADOptions);
}
Here is the applescript
tell application "Adobe Illustrator"
activate
set inputs to "Macintosh HD:Users:bbb:Desktop:TEST:Test_PDF.pdf" as string
set outputFolder to "Macintosh HD:Users:bbb:Desktop:TEST:Final.dwg" as string
set params to {}
open file inputs
do script "CGExportAsDWG"
close current document
end tell
