Change var width=app.documentPreferences.pageSize to var width=app.documentPreferences.pageWidth.
designmon79, thanks for poiting this out. I made a typo while typing my post.
Is "app.documentPreferences" the correct way to access "Document Setup"? Can anybody please try to change the size + width to something else and see if it works.
app.documentPreferences.pageHeight = 500;
app.documentPreferences.pageWidth = 500;
I have tried and its changing the active doc size. Try below code:
var width = myDoc.documentPreferences.pageWidth=60;
var height = myDoc.documentPreferences.pageHeight=90;
Thank you very much. It works.