There is no simple built-in command to center a window on a Mac. But you can use other techniques. Learn how to combine two window movements to center a window, or use scripted Shortcuts, or a third party app.
You can also watch this video at YouTube (but with ads).
Here’s a link to the Shortcut: https://www.icloud.com/shortcuts/a6ab0cc9920648c895b74f30c0e958f6
Gary: Thanks for the great tutorial. Double-clicking at the top of a window is a convenient gesture wasted on the zoom output, a lottery. I know you can change the output of double-clicking to minimize a window.
Having picked up on one of your tips, I am now using Hide instead of Minimize. How difficult would it be to assign say Option-DoubleClick gesture to Hide or your Center Window script?
Razvan: You can't change how things like Option+double click work. There's no customization for that.
I entered the script into Shortcuts shown at the 4:00 minute mark of your video, double-checked it for accuracy. It is giving me an error, saying 'Error: Error: Application can't be found.' Could you advise why? I could send you a screenshot.
(Incidentally, I used the Automator version of your centering technique a while back (on 2 separate iMacs); it worked for a while, but eventually I was getting so many errors I just gave up on it.)
I appreciate your helpful content. 🙏🏻
Bryan: Perhaps you didn’t grant Shortcuts the permissions it needed when it first asked? Check I System Prefs, Security and Privacy.
It's not working when trying to centralize the miniplayer from the apple music app. Could you help by tweaking the code or something else?
Thank you in advance!
Lucas: That's because the MiniPlayer is not a normal window.
Infinite thanks !!!