So I have to go back into the Preferences Audio Hardware and switch it back to speakers! This is crazy and never used to be a problem. But then if I unplug the headphones jack, the audio output does not automatically switch back to the speakers as it used to (and should).
I now have to go to After Effects Preferences, Audio Hardware, and change the Default Output Settings settings from speakers to headphones. But this does not happen when in After Effects. When using the iMacPro 'normally' - viewing YouTube clips online or playing a Quicktime movie or using iTunes for example - the audio automatically switches from speakers to headphones when you plug the headphones in - as you would expect.
When using After Effects in the past and previewing a comp the audio would automatically switch between speakers and headphones if and when I plugged in the headphone jack. (iMacPro mcOS Mojave 10.14.1, Adobe After Effects CC2018 15.1.2) Audio in AE not switching between speakers and headphones.