0

I've been customizing my Mac to enhance my productivity and there’s one last hiccup: the Dock's behavior with spaces and opening new windows.

Context
I use separate spaces for different activities—math class, cooking, etc., and common applications like Safari, Spotify, and Notes are used across all.

The Problem
Let’s say I’m in my math space and need to open Safari. Since Safari is already running in other spaces, launching it here involves:

  1. Activating Safari.
  2. Pressing CMD + N to open a new window (or, even more cumbersome, right-clicking the Dock and selecting 'New Window').

I have the “When switching to an application, switch to a Space with open windows for the application” setting turned off. Therefore, clicking Safari in a new space activates it but doesn't switch spaces.

Desired Behavior
I want the Dock to automatically open a new window if an app is activated without any open windows in the current space. For most apps, CMD + N opens a new window, but others like OneNote use CTRL + M.

Proposed Solution I'm considering an AppleScript that monitors each application's window count and its activation status in the current space. If an app is activated with no open windows in that space, it would trigger the appropriate keyboard shortcut to open a new window.

Is this operation something that can be scripted or automated?

0

You must log in to answer this question.

Browse other questions tagged .