There is no scripting API for layout, no. 😞