Unfortunately Im not a programmer so I cant help you there but don't you create the file last when you hit save? Aren't all the items you enter placeholders for options that have been selected which will be saved into the file.
Only other suggestion I have is reorder the contents of the tabs so the workflow order is from top to bottom of the tab. IE; picking the default units would be the first item in the Machine Tab, then select Mesa card, then test card,