Is there a way to move all windows back to the iMac (from HDTV)? My iMac is hooked up to an HDTV, and sometimes I move windows over to the HDTV.

But sometimes, my HDTV is not powered on, or it is set to the cable box, and I can't find the windows (apps) on my iMac, and there seems to be no way to see those windows (apps) without first changing the HDTV to view the iMac and moving the windows back to the iMac screen.

Or maybe another way is to unplug the HDMI connector.

But there should be a software way to do it... either by Settings or by a script, or maybe just by some function or command key combinations?
You could try going into System Preferences &gt; Displays &gt; Arrangement and check Mirror Displays. From here, unchecking it should bring all your windows back to your main screen.