Copy link to clipboard
Copied
I have a simple two-line script:
app.activeDocument.pasteboardPreferences.pasteboardMargins = ['200 mm',0];
app.activeDocument.pasteboardPreferences.matchPreviewBackgroundToThemeColor = 1;
When I run it, only the last preference change is actually applied (in this case, changing the preview background). If I switch the order of lines, only the margins get changed. Why does this happen, and what is the best practice for avoiding it?
Using Adobe InDesign 18.0 on Windows 10.
Copy link to clipboard
Copied
Hi @gdwd I'm running Indesign 18.0 on MacOS 13, and I can confirm the same behaviour.
In my quick testing it seems that: setting matchPreviewBackgroundToThemeColor to 1 sets the pasteboardMargins to [0,0]. I have lodge a bug. Please vote to have it fixed.
- Mark
Copy link to clipboard
Copied
Same here, even with using "properties" property and passing the whole set at once or using a true Boolean value instead of 1.
Copy link to clipboard
Copied
Thanks Loic, yes I tried using properties, too. Also tried wrapping it in a doScript call. Tried in Applescript and the matchPreviewBackgroundToThemeColor couldn't seem to be set at all.
Copy link to clipboard
Copied
Hi @gdwd ,
seems that this statement alone, set to true or false, it does not matter:
app.activeDocument.pasteboardPreferences.matchPreviewBackgroundToThemeColor = true;
sets the pasteboardMargins to [0,0]. Tested with my German InDesign 2023 version 18.1 on Windows 10.
Voted for fixing the bug!
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
To work around the issue with matchPreviewBackgroundToThemeColor one could use the corresponding menuAction.
app.menuActions.itemByName("$ID/Match Pasteboard to Theme Color").invoke();
But it's impossible to know in which direction the change is going. This menu action could turn it on or off.
The second line will always return false; even if you run the script two times:
app.menuActions.itemByName("$ID/Match Pasteboard to Theme Color").invoke();
app.activeDocument.pasteboardPreferences.matchPreviewBackgroundToThemeColor;
Regards,
Uwe Laubender
( Adobe Community Expert )