Skip to main content
Participant
Sep 19, 2025 1:51 PM UTC
Answered

Modifing the master page through ExtendScript

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
frameexpert
frameexpertCorrect answer
Community Expert
Sep 22, 2025 12:15 PM UTC

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

www.frameexpert.com

6 replies

Community Expert
Sep 22, 2025 6:38 AM UTC

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

Translate
theo_7188Author
Participant
Sep 22, 2025 12:03 PM UTC

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

Translate
frameexpert
Community Expert
frameexpertCommunity ExpertCorrect answer
Community Expert
Sep 22, 2025 12:15 PM UTC

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

Translate
www.frameexpert.com
frameexpert
Community Expert
Community Expert
Sep 19, 2025 2:50 PM UTC

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.

Translate
www.frameexpert.com
theo_7188Author
Participant
Sep 22, 2025 12:00 PM UTC

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 !

Translate