# Reading the User Interface Scaling Value in UXP

**URL:** <https://forums.creativeclouddeveloper.com/t/reading-the-user-interface-scaling-value-in-uxp/6886>\
**Category:** InDesign\
**Tags:** javascript\
**Created:** [September 28, 2023, 12:36pm UTC](https://forums.creativeclouddeveloper.com/t/reading-the-user-interface-scaling-value-in-uxp/6886 "2023-09-28T12:36:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![medium\_jon](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/medium_jon/32/2371_2.png) [@medium\_jon](https://forums.creativeclouddeveloper.com/u/medium_jon)\
**Post date:** [September 28, 2023, 12:36pm UTC](https://forums.creativeclouddeveloper.com/t/reading-the-user-interface-scaling-value-in-uxp/6886/1 "2023-09-28T12:36:00Z")

</div>

We’re working on a UXP based plug-in for Adobe InDesign and trying to handle with the user adjusts the `User Interface Scaling`. In macOS one way to reach this this is at `InDesign > Preferences > User Interface Scaling...`  
I never did figure out how to properly handle it in ExtendScript with ScriptUI. But I’m hoping that UXP provides something.

**Questions** :

1. Is there a way to read what the value is via JavaScript?

2. Is there some CSS way of responding to different settings?

3. Anything else I should know?

jsw

---

<div class="post-metadata">

**Author:** ![sttk3](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sttk3](https://forums.creativeclouddeveloper.com/u/sttk3)\
**Post date:** [September 30, 2023, 5:17am UTC](https://forums.creativeclouddeveloper.com/t/reading-the-user-interface-scaling-value-in-uxp/6886/2 "2023-09-30T05:17:38Z")

</div>

#### 1. Is there a way to read what the value is via JavaScript?

It seems there is no way to get it directly. In ExtendScript, Marc Autret shows how to get it by using the ScriptUI window.  
[Indiscripts :: ScriptUI vs. UI Scaling](https://indiscripts.com/post/2021/03/scriptui-vs-ui-scaling)

I was able to get it in UXP by executing that ExtendScript via doScript.

```auto
const InDesign = require('indesign') ;
const { app, ScriptLanguage, UndoModes } = InDesign ;

// [Indiscripts :: ScriptUI vs. UI Scaling](https://indiscripts.com/post/2021/03/scriptui-vs-ui-scaling)
const uiScaling = `(function(w) {
  (w=new Window('palette','')).margins=0;
  w.add('group').minimumSize=[500,500];
  w.layout.layout(1);
  return [w.size[0]/500,w.size[1]/500];
})();` ;

console.log(app.doScript(uiScaling, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT)) ;
// --> [1.25, 1.252] ;

```

#### 2. Is there some CSS way of responding to different settings?

I am not familiar with CSS, but Media Queries might be close to what you are looking for.

#### 3. Anything else I should know?

These information may help.

- app.generalPreferences.useCustomMonitorResolution
- app.generalPreferences.customMonitorPpi
- app.generalPreferences.mainMonitorPpi

---

<div class="post-metadata">

**Author:** ![medium\_jon](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/medium_jon/32/2371_2.png) [@medium\_jon](https://forums.creativeclouddeveloper.com/u/medium_jon)\
**Post date:** [September 30, 2023, 12:23pm UTC](https://forums.creativeclouddeveloper.com/t/reading-the-user-interface-scaling-value-in-uxp/6886/3 "2023-09-30T12:23:31Z")

</div>

That looks very helpful. Thank you @sttk3
