Is it possible to create a button or command to LayOut


I am wondering, whether it is possible to add a button that would call a manually written function ?
E.g. I want to Export Layout with predefined parameters with just one button click. So can I program a button in Layout application that calls Export function with parameters I want ?