1

I'm using a 2011 iMac running MacOS Sierra with an HDMI output connected to a projector. When I want to watch a film on the projector, I just drag iTunes over to the second display and watch. If I forget to drag iTunes back, it ends up stuck on the other display. This is because the Mac still sees the second display when the projector is turned off. This means the only way to get iTunes back on the main iMac display is to turn the project back on so I can see the iTunes window and drag it back across to the main display. This also happens to any other app I "leave behind" on the external display and forget to drag back over. What I've tried:

  • Quitting and relaunching the app. This doesn't work, as MacOS remembers which display the app was on previously and re-launches it on that display
  • Finding the app in Mission Control. This doesn't work, because each display has its own Mission Control. I therefore can't see the spaces on the external display in order to grab the iTunes window and drag it to a space on the built-in display
  • Right-clicking the app icon in the dock and selecting "Show all windows". This just displays my wallpaper with a message in the centre saying "No available windows" (presumably because the window is on the external display).

I am hoping there's a key combination or some other trick to force the windows of the app to move over to the current display.

  • When I use VLC and stream things to my Apple TV, I've configured it in such a way that when I click "Full Stream", macOS puts it on the TV and not-Full Screen returns to my main display. This way, if I forget, a mere "Escape" gets the invisible window accessible again. – Zonker.in.Geneva Aug 28 '17 at 14:21
0

If you want a trick, you could briefly unplug the HDMI cable from the iMac. That should signal Mac OS that there is only one display and it will move all windows to the only remaining display.

  • Unfortunately this doesn't work. Although all the windows are collated on the built-in display when the HDMI cable is unplugged, they go back to the external display when you re-connect the cable. – mashers Aug 28 '17 at 19:09
  • they go back to the external display when you re-connect the cable - It seems that after I updated my mac to High Sierra they do not do this anymore :( – JaakL Apr 20 '18 at 7:57
0

The following Applescript does the job:

tell application "iTunes"
    set position of windows to {100, 100}
    activate
end tell

I did try adding text input so you could use it for other apps too, like this:

set theApp to the text returned of (display dialog "Which app do you want to bring back?" default answer "")

tell application theApp
    set position of windows to {100, 100}
    activate
end tell

Unfortunately it then no longer recognises the 'position' attribute of 'windows'. I considered wrapping the tell block in using terms from application theApp, but this didn't work as using terms from application seems to require a named app, not a variable. Forcing it with using terms from application "iTunes" works if you type "iTunes" into the text prompt, but any other app causes an error in matching the position property.

I have knocked up a quick app in XCode which provides the text input for the name of the app, and then embeds this in an Applescript. The Applescript moves all of the windows of the specified app into the position specified by xOffset and yOffset, on the currently selected display. The app could be made nicer by adding a selection menu of the currently running apps, or even a way of specifying the position the windows should be moved to. This wouldn't be difficult to do, so I might play around with it some time.

Anyway, the source code for the app is on GitHub, so if anyone else finds it useful, here it is.

https://github.com/mashers/BringAppsBack

0

Although I'm currently not able to test them, since I don't have a second display at hand right now, I had some ideas:

  • There is an option in Mission Control Settings called "Displays use separate spaces". Can you see the spaces of your projector in Mission Control on your Mac, with this option unchecked?
  • If you use iTunes in fullscreen mode, do you see it in Mission Control on your Mac?
  • "Magnet" from the Mac App Store gives you a keyboard shortcuts for moving windows between displays. Its currently reduced (at least in the Austrian MAS) and costs 1,09€ / ~1$.
  • Thanks for your suggestions. Displays use separate spaces didn't make any difference - I couldn't work out what it actually did, as there was no discernible difference (yes I logged out and back in after changing the option). It makes no difference if iTunes is in full screen mode. Thanks for the recommendation of Magnet. I've actually written a little app to do specifically what I need (see my answer below) so I'll use that in the absence of a built-in method to do it. – mashers Aug 29 '17 at 16:41
  • I was able to test Displays use separate spaces today. If unchecked, the spaces position of the two displays is synchronised, meaning, that you always have the same number of spaces on both displays and if you switch spaces, it will do so on both monitors. For full-screen apps this means, that one of the displays will show a black screen. -- still doesn't help with your problem though. – buboh Aug 31 '17 at 10:09
  • Thank you @buboh - that's a helpful description. It seems like a bit of a useless setting TBH, but at least now I know what it does. It's really weird how there is no way of accessing spaces on a different display. It just seems like an oversight. Anyway, I've accepted my own answer below with a link to the GitHub repo for the app I wrote to resolve this problem. – mashers Aug 31 '17 at 11:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .