Skip to main content
Participant
September 19, 2025
Answered

Modifing the master page through ExtendScript

  • September 19, 2025
  • 2 replies
  • 214 views

Hi everyone,
I would like to use ExtendScript to modified the master page of my document but it doesn't work.
Here is my code:

 

var doc = app.ActiveDoc;
var mp = doc.FirstMasterPageInDoc;

var tempWidth = mp.PageWidth;

mp.PageWidth = mp.PageHeight;
mp.PageHeight = tempWidth;

When I look into my variable with a debugger, it behave like it is in read-only mode
Correct answer frameexpert

You can rotate a master page in the interface (Format > Customize Layout), but I can't find a property to do it programmatically.

2 replies

Community Expert
September 22, 2025

Hi Theo,

Did you want to modify the page dimensions? -> See Rick's post.

Or the main text frame dimensions and its position?

Best regards, Winfried

theo_7188Author
Participant
September 22, 2025

I'm trying to make some pages move into landscape mode.
It seems pretty basic to me so I assume it's possible but I don't know how, can you help me with that ?
Best regard, Théo

frameexpert
Community Expert
frameexpertCommunity ExpertCorrect answer
Community Expert
September 22, 2025

You can rotate a master page in the interface (Format > Customize Layout), but I can't find a property to do it programmatically.

frameexpert
Community Expert
Community Expert
September 19, 2025

This screenshot is from the FDK Reference, which is more useful than the ExtendScript documentation. The dagger indicates a read-only property. A FrameMaker document can only have a single size for all of its pages.

theo_7188Author
Participant
September 22, 2025

Thank you for the awnser !
Changing the dimension was a workaround I was thinking about to make some specific pages to turn into a landscape mode, do you know if there is a parameter I can change in extendscript to do that ?
Thanks in advance for your awnser !