Highlighted

Script or action to set open vector drawing's units to inches and artboard to 24"x24"

New Here ,
Oct 24, 2020

Copy link to clipboard

Copied

I am bringing in a large number of vector files from different sources. When opened the vector drawings have units set to points, mm, etc. and various sized artboards. For each opened vector drawing I want to set the unit to inches and the artboard to 24"x 24". I am setting each of these parameters manually in Document Setup for each vector. Is there a script or action that will allow setting one or both of these parameters? I apologize in advance if there is a simple way to do this that I am unaware of. Any guidance would be appreciated.

TOPICS
How to, Import and export, Scripting, Tools

Views

56

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Script or action to set open vector drawing's units to inches and artboard to 24"x24"

New Here ,
Oct 24, 2020

Copy link to clipboard

Copied

I am bringing in a large number of vector files from different sources. When opened the vector drawings have units set to points, mm, etc. and various sized artboards. For each opened vector drawing I want to set the unit to inches and the artboard to 24"x 24". I am setting each of these parameters manually in Document Setup for each vector. Is there a script or action that will allow setting one or both of these parameters? I apologize in advance if there is a simple way to do this that I am unaware of. Any guidance would be appreciated.

TOPICS
How to, Import and export, Scripting, Tools

Views

57

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 24, 2020 0
Engaged ,
Oct 25, 2020

Copy link to clipboard

Copied

Assuming one artboard, this should resize it:

var AB = app.activeDocument.artboards[0];
var w = 24 * 72;
var h = 24 * 72;
AB.artboardRect = [AB.artboardRect[0], AB.artboardRect[1], w, -h];

Adding this line

app.executeMenuCommand("unitundoPref");

 at the end will bring up the units dialog box, but you will have to select your units manually.  Also, this causes buggy behaviour for me in CS6.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 25, 2020 1
New Here ,
Oct 26, 2020

Copy link to clipboard

Copied

Thank you!

--
Matthew

 



[ private informations removed by moderator for security reasons ]

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 26, 2020 0
Resources