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

How to correctly change the common units of the current document?

Engaged ,
Oct 11, 2024 Oct 11, 2024

Copy link to clipboard

Copied

To change current documet units I use this: 

 

function setUnits() {
    var units = 5; //(0 to 6)
    app.preferences.setIntegerPreference("rulerType", units);
}

 

When I say "current documet units" I mean the units of measurement in the transformation window and on the ruler. 
However, in order to “see” the new units of measurement, you need to create a new document.

 

How can I make these changes appear in the current document?

TOPICS
How-to , Scripting

Views

366
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
Adobe
Community Expert ,
Oct 11, 2024 Oct 11, 2024

Copy link to clipboard

Copied

Well, wow, amazingly there doesn't seem to be any good way to do this. Incredible! Sorry for bad news. I take it you've seen the workarounds, such as making new document and copy/pasting, or saving uncompressed and editing raw .ai file? Both terrible options when all you want to do is set the document ruler units. SIgh.

- Mark

Votes

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 ,
Oct 11, 2024 Oct 11, 2024

Copy link to clipboard

Copied

I have lodged a bug report. Please vote to have it fixed. - Mark

Votes

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 ,
Oct 11, 2024 Oct 11, 2024

Copy link to clipboard

Copied

In the file > document configuration tab (Alt+Ctrl+P) I can change the document's unit of measurement, when I change it there it ignores the default unit settings that are in Edit>preferences>units

This change affects everything, including the transform window and the rulers.

From what I understand, that would be it, right?

Votes

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
Advocate ,
Oct 11, 2024 Oct 11, 2024

Copy link to clipboard

Copied

Un clic droit sur l'une des règles,

renl80416020_0-1728643726333.pngexpand image

 

Votes

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
Engaged ,
Oct 11, 2024 Oct 11, 2024

Copy link to clipboard

Copied

@christianot40873293 not exactly, we are talking here in the context of script execution

Votes

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
Enthusiast ,
Oct 14, 2024 Oct 14, 2024

Copy link to clipboard

Copied

LATEST

Not the easiest way, but for PC users, we can launch the Document Setup window with app.executeMenuCommand("document") and then run a VBScript that emulates keystrokes to select units from the drop down list.

Votes

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