Is it even possible?
The closest I've gotten to it is about 2 steps shy of actually applying the custom masterpage.
Fcodes([app.GetNamedCommand("MasterPageUsage").Fcode])
This gets the dialog box open but how do you choose the custom masterpage by name and apply it without opening a dialog box?
And on the flip side, if a custom masterpage is already set, how do you change it back to the default, "Right"?
Cheers