• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

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

229

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

Guide , 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;

 

Votes

Translate

Translate
Adobe
Guide ,
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;

 

Votes

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.

Votes

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!

Votes

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