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

Is there a function for converting units in Extendscript?

Explorer ,
Apr 21, 2022 Apr 21, 2022

Copy link to clipboard

Copied

Is there a function I call call to convert between units in Extendscript? If not, what are the conversion factors Indesign uses to convert between units?

TOPICS
How to , Scripting

Views

431

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

Community Expert , Apr 21, 2022 Apr 21, 2022

Votes

Translate

Translate
Community Expert ,
Apr 21, 2022 Apr 21, 2022

Copy link to clipboard

Copied

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
Guide ,
Apr 23, 2022 Apr 23, 2022

Copy link to clipboard

Copied

LATEST

Hi Uwe, thanks for the mention 😉

 

FYI, additional details and code tricks on UnitValue are exposed in IdExtenso's $$.Unit module:

https://github.com/indiscripts/IdExtenso/blob/master/etc/%24%24.Unit.jsxlib

 

Best,

Marc

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
Community Expert ,
Apr 21, 2022 Apr 21, 2022

Copy link to clipboard

Copied

Hi Ben, if by units you mean ruler units, you can also set the measurement units used by the script via app.scriptPreferences. I used this in response to your other post about setting a line’s length—without setting the scriptPreference,  the length of the line you add would change depending on the user’s ruler settings

 

 

 

 

app.scriptPreferences.measurementUnit = MeasurementUnits.POINTS;

 

 

 

 

https://community.adobe.com/t5/indesign-discussions/how-to-call-for-graphic-line-length-using-extend...

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