function saveUnsavedProfiles()
    % Save any profiles with unsaved changes
    ProfileModels = pe.toolstrip.doGetProfileModels();
    for idx = 1 : length(ProfileModels)
        m = ProfileModels(idx);
        profile = systemcomposer.internal.profile.Profile.getProfile(m);
        if profile.dirty
            profile.saveToFile();
            systemcomposer.loadProfile(profile.getName);
            
        end
    end
end