gathering windows with automator
Do you use your laptop with an external display? (Note: Only talking to Mac users here) If so, this might be of use to you.
This is an old photo of my set up, as I now have a different keyboard/mouse combo & a stand for my laptop. I’ll take a new photo soon of it all set up in my new office!I use my MacBook Pro with an external monitor (a Cintiq 21ux, which is awesome). However, traveling with my laptop – from my office to home, or out to a cafe – I find that after I plug my external display back in, all of the windows are scattered between the two, when I’d like them to all be on the larger external screen.
Awhile back I’d searched around for a fix on this, but never really found a good solution that worked, and eventually resorted to simply going up to the Displays menu (that I keep accessible in the top menu bar), hitting “Turn On Mirroring” which mirrors all your content on each displays. Then, after waiting for it to re-adjust all the windows, go back into the Display pulldown again to “Turn Off Mirroring”, which finally results in what I want: All of the windows are gathered on one (my external/larger) display. If you’re curious, from here I usually only put iTunes & Tweetdeck on my smaller laptop screen.
Annoyed at this process (I know, big problems, huh?), I thought *surely* there’s a way to make a script that does this for me. I mean, it is a Mac after all! So I took it upon myself to see if I could make an Automator script to take care of it for me…and I did it! :)
It’s not perfect (only that a few times it hasn’t closed the System Preferences afterwards for me), but other than that it works great! Should you be interested in trying it out, feel free to download the Toggle Screen App I created.
Essentially it just does all those steps I listed out above, but it’s like there’s a ghost in my machine doing it for me. While it’s doing that I can plug in my power cord, take off my jacket & get settled.
Here’s the steps, and a screenshot of these steps as seen in the Automator workflow:
- Opens System Preferences
- Clicks the “Displays” button.
- Clicks the “Arrangement” tab.
- Clicks the “Mirror Displays” checkbox.
- Clicks the “Arrangement” tab.
- Clicks the “Mirror Displays” checkbox.
- Clicks the “System Preferences” menu.
- Quits System Preferences

Want to try this app for yourself?
- Download ToggleScreen.zip
- Unzip the file
- Put the Toggle Screen.app anywhere you’d like it to live. I keep mine in the /Applications/Utilities folder, and then leave an instance in the Dock, so I can easily hit it after my plub my external monitor in.
This is basically my first Automator script/app, so I’m sure it can be perfected. I’d love to hear feedback, or see it improved upon. Either way, hopefully I helped someone out there who was dealing with this same issue.

YOU ARE BRILLIANT! :)
So fun learning handy Mac tips. Had not yet played with Automator. Love it!