import maya.cmds as cmds def runThis(): print "Loading my saved layout" #1. need to check if the layout has been saved. i.e. exists ## TO DO LOOK UP IF FILE EXISTS #2. if the file exists: cmds.workspaceLayoutManager(setCurrent="Rigging") cmds.evalDeferred( runThis )