Open and move windows between displays automatically
When I was visiting my pal Myke Hurley in London last year, I noticed that he had a second display to the right of his main one.…
Last year, during an impromptu visit to London, I noticed a second display to the right of my friend Myke Hurley's primary monitor. This vertical, large display was perfect for recording podcasts, as he could keep all recording information there while they were in progress. I found the idea intriguing and wished for a second display myself, even though my main Mac was already a MacBook Pro.
Over time, I developed a system to record podcasts using the "Hurley Method," positioning the Audio Hijack windows on my laptop's display to the left. I grew fond of this setup, but I couldn't help but feel frustrated by the numerous clicks and drags required every time I recorded a podcast. Thus, I sought to automate the process.
Initially, my automations didn't function unless the laptop was open, so my first step was to confirm its availability. By utilizing the command-line command `system_profiler SPDisplaysDataType`, I could check for the built-in display's presence by searching for the text string "Built-in." I integrated this check into an existing Keyboard Maestro macro, which was triggered by an Elgato Stream Deck.
To ensure the macro only ran when multiple screens were attached and the internal MacBook Pro display was active, I created two additional if/then statements within the macro. However, automating Audio Hijack proved challenging, as the app lacks direct automation support through Keyboard Maestro. To overcome this obstacle, I constructed a Shortcut that utilized JavaScript to open a specific Audio Hijack session by name, passing the session name as input to the Shortcut.
With the MacBook Pro display confirmed open and the Audio Hijack session window prepared, I devised a one-step command in Keyboard Maestro to relocate the window. This required using custom "smart" values in the Move and Resize Window command, positioning the window approximately 600 pixels to the left and 250 pixels up from the center of the internal display.
After meticulously adjusting the dimensions, my podcast recording sessions automatically appeared on the laptop display whenever I activated the recording button on my Stream Deck.
Written by urgent.news from Six Colors's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.