Create new document in illustrator with units set in millimetres

So i figured this, but every time i try to set the units to millimetres I got only errors.
I’m new at this, applescript and I managed to to all I need with illustrator but the only thing I can’t change are the units of the document.
I want to create a new document with the units set to millimetres us by default are set to points.
How can i do this? I
Is there someone who can help me?
I search on internet but i didn’t find anything that could help me.


tell application "Adobe Illustrator"
	activate
	make new document with properties {name:"TEST", height:100, width:100, ruler origin:{0.0, 0.0}, color space:CMYK}
end tell

Model: MacBook Pro
AppleScript: 2.10
Browser: Safari 604.3.5
Operating System: Mac OS X (10.13 Developer Beta 3)

it should be like this, but it doesn’t work…
Help please!


tell application "Adobe Illustrator"
	activate
	make new document with properties {name:"TEST", ruler units: millimeters, height:100, width:100, ruler origin:{0.0, 0.0}, color space:CMYK}
end tell

Hi. Unfortunately it doesn’t work because Adobe didn’t implement the feature in AppleScript; there’s a note in the documentation that “add document” can only be done using JavaScript. You could workaround that by (1) having an action create the document with the desired units, (2) opening a template already set up with the desired properties, or (3) using a handler to perform the dimensional analysis from points to the desired unit.

Hi
I use something similar to this, as a work around, works really well, you could add a UI script after to alter the ruler setting from points to mm

property mm : 2.834645 as number

tell application "Finder"
	set _NewfileName to "TEST"
	set _SaveLocation to ((path to desktop) as string)
end tell

tell application "Adobe Illustrator"
	set _NewDoc to make new document with properties {color space:CMYK, height:(100 * mm), width:(100 * mm)}
	
	set ruler origin of _NewDoc to {0, 0}
	
	set _DocName to name
	set _NewName to (_SaveLocation & _NewfileName) as string
	
	save _NewDoc in file _NewName with replacing
	--close _NewDoc --saving yes
end tell