Autodetect automation console/GUI depending on file extension.