Replace indesign.idml_to_indd() with a more generic save_as() function.