Skip to main content
ronaldw32492598
Participating Frequently
April 8, 2025
Answered

Writing a script to expand the pasteboard size

  • April 8, 2025
  • 1 reply
  • 1137 views

I'm very new to scripting and was using ChatGPT to work through a way to expand the pasteboard size of the current openend document. I found a way to make a script expand the slug area, but that isn't what I needed. Here's the final message I received.

 

InDesign scripting API doesn't give direct access to pasteboardPreferences through the Spread object. Even though pasteboardMargins is editable in the InDesign UI (in Preferences > Guides & Pasteboard), it's unfortunately not exposed through scripting on a per-spread or global level.

 

I just wanted to check if anyone knows that this is true, so I can either stop my quest or keep trying. 

Thanks!

Correct answer Manan Joshi

Yes, I was able the script to increase the slug area, but that's the message it gives when asking about the pasteboard. 


ChatGPT spits out garbage many times, forget it. Check the API link reference I gave above. I used the following code and it did change my pasteboard size.

app.documents[0].pasteboardPreferences.pasteboardMargins = [20,20]

P.S. :- Execute this code with an open document, else you would get an error

-Manan

1 reply

Community Expert
April 8, 2025

You should be able to do it via the PasteboardPreference objects pasteboardMargins property. You can access PasteboardPreference via code like

app.pasteboardPreferences

or

app.documents[0].pasteboardPreferences

https://www.indesignjs.de/extendscriptAPI/indesign-latest/index.html#PasteboardPreference.html

-Manan

-Manan
ronaldw32492598
Participating Frequently
April 8, 2025

The message I received is that app.pasteboardPreferences or pasteboardMargins doesn't exist in InDesign's scripting API. It says that the vertical pasteboard margin setting is UI-only, not exposed to scripts.

Community Expert
April 8, 2025

Who said that ChatGPT?

-Manan

-Manan