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)];
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
...
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 š
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.
Copy link to clipboard
Copied
@m1bThanks so much, really apprecitate it. Works exactly how I wanted it.
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 š
Copy link to clipboard
Copied
Absolute legend.