Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Need a script to round an object's width up (or down) to a 1/1000th inch from 1/10,000th inch

Explorer ,
Nov 18, 2020 Nov 18, 2020

Copy link to clipboard

Copied

I set type for highway signage, and the typefaces get very close to being perfectly at 1/1000th, but are always a few 10,000ths up or down from what I need when outlined. Each word has a specific exact width spec'ed in 1000ths. Currently I have to manually click in the measurements palette, select the last two numbers and change each width manually. A script to change the width up or down to the next 1000th would save me work every day.

TOPICS
Draw and design, Print and publish, Scripting, Tools

Views

120

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
community guidelines

correct answers 1 Correct answer

Advocate , Nov 18, 2020 Nov 18, 2020
This should round up/down the height and width of a selected path to 3 decimal places.var h = ( app.selection[0].height ) / 72; var w = ( app.selection[0].width ) / 72; app.selection[0].height = ( h.toFixed(3) ) * 72; app.selection[0].width = ( w.toFixed(3) ) * 72;

Likes

Translate

Translate
Advocate ,
Nov 18, 2020 Nov 18, 2020

Copy link to clipboard

Copied

This should round up/down the height and width of a selected path to 3 decimal places.

var h = ( app.selection[0].height ) / 72;
var w = ( app.selection[0].width ) / 72;
app.selection[0].height = ( h.toFixed(3) ) * 72;
app.selection[0].width = ( w.toFixed(3) ) * 72;

 

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
community guidelines
Explorer ,
Nov 18, 2020 Nov 18, 2020

Copy link to clipboard

Copied

Amazing, thanks, I'll give it a try and report back.

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
community guidelines
Explorer ,
Nov 18, 2020 Nov 18, 2020

Copy link to clipboard

Copied

LATEST

Works great, and I managed to puzzle out how to add 1000th or subtract 1000th in separate scripts. Thanks again!

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
community guidelines