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

Script request: Adding display quality settings to existing script

Participant ,
Apr 19, 2023 Apr 19, 2023

Copy link to clipboard

Copied

I have the script below which toggles between Preview and Normal screen modes. I'm hoping someone would be able to edit/add to it so that when it's in Normal screen mode, it sets the Display Performance to Typcial Display and when it's in Preview screen mode it sets the Display performance to High Quality Display. Tried chatGPT but it wasn't helpful so any help would be greatly appreciated, thanks.

 

var nextMode = {

'PREVIEW_OFF' : ScreenModeOptions.PREVIEW_TO_PAGE,

'PREVIEW_TO_PAGE': ScreenModeOptions.PREVIEW_OFF

}


app.documents[0].layoutWindows[0].screenMode = nextMode[String(app.documents[0].layoutWindows[0].screenMode)];

 

TOPICS
Scripting

Views

420

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 2 Correct answers

Community Expert , Apr 19, 2023 Apr 19, 2023

Hi @danielw42205661, I'd go with something like this:

 

 

var lw = app.documents[0].layoutWindows[0];

if (lw.screenMode !== ScreenModeOptions.PREVIEW_TO_PAGE) {
    // switch to high quality preview
    lw.screenMode = ScreenModeOptions.PREVIEW_TO_PAGE;
    lw.viewDisplaySetting = ViewDisplaySettings.HIGH_QUALITY;
    app.displayPerformancePreferences.ignoreLocalSettings = true;
}

else {
    // switch to typical screen mode
    lw.screenMode = ScreenModeOptions.PREVIEW_OFF;
    lw.viewDisplayS
...

Votes

Translate

Translate
Community Expert , Apr 19, 2023 Apr 19, 2023

Great! By the way, I edited the code. It is functionally the same, I just didn't like the way I'd done it before. You can use either way 🙂

Votes

Translate

Translate
Community Expert ,
Apr 19, 2023 Apr 19, 2023

Copy link to clipboard

Copied

Hi @danielw42205661, I'd go with something like this:

 

 

var lw = app.documents[0].layoutWindows[0];

if (lw.screenMode !== ScreenModeOptions.PREVIEW_TO_PAGE) {
    // switch to high quality preview
    lw.screenMode = ScreenModeOptions.PREVIEW_TO_PAGE;
    lw.viewDisplaySetting = ViewDisplaySettings.HIGH_QUALITY;
    app.displayPerformancePreferences.ignoreLocalSettings = true;
}

else {
    // switch to typical screen mode
    lw.screenMode = ScreenModeOptions.PREVIEW_OFF;
    lw.viewDisplaySetting = ViewDisplaySettings.TYPICAL;
    app.displayPerformancePreferences.ignoreLocalSettings = false;
}

 

 - Mark

 

Edit 2023-04-20: refactored for more sensible code.

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
Participant ,
Apr 19, 2023 Apr 19, 2023

Copy link to clipboard

Copied

@m1bThanks so much, really apprecitate it. Works exactly how I wanted it.

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 19, 2023 Apr 19, 2023

Copy link to clipboard

Copied

Great! By the way, I edited the code. It is functionally the same, I just didn't like the way I'd done it before. You can use either way 🙂

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
Participant ,
Apr 19, 2023 Apr 19, 2023

Copy link to clipboard

Copied

LATEST

Absolute legend.

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