Friday, December 15, 2017

#1 2017-11-19 06:44:32 pm

bogdanko
Member
Registered: 2017-03-04
Posts: 2

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.


Applescript:


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)

Last edited by bogdanko (2017-11-19 07:11:13 pm)

Offline

 

#2 2017-11-19 07:08:32 pm

bogdanko
Member
Registered: 2017-03-04
Posts: 2

Re: Create new document in illustrator with units set in millimetres

it should be like this, but it doesn't work....
Help please!

Applescript:


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

Last edited by bogdanko (2017-11-19 07:10:35 pm)

Offline

 

#3 2017-11-20 07:40:33 pm

Marc Anthony
Member
From:: Dallas, TX
Registered: 2006-04-27
Posts: 772

Re: Create new document in illustrator with units set in millimetres

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.

Offline

 

#4 2017-11-20 08:25:15 pm

Budgie
Member
From:: New Zealand
Registered: 2005-02-22
Posts: 643

Re: Create new document in illustrator with units set in millimetres

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

Applescript:

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


Budgie

"Our greatest glory is not in never falling, but in rising every time we fall"    - Batman

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)