Hacker News new | ask | show | jobs
by kstrauser 244 days ago
But... why?

Anyway, you're on a Mac. Fix it yourself. Run the Shortcuts app and create a shortcut called something like "Maximize Preview". Set it to run an AppleScript:

  on run {input, parameters}
    tell application "Preview" to activate
    tell application "System Events" to set value of attribute "AXFullScreen" of front window of (first process whose frontmost is true) to true
    return input
  end run
(Download that from https://www.icloud.com/shortcuts/96b7c0fef90a408ba3c3bcaedfb... if you trust me — which you probably shouldn't — and you don't want to type it in.)

Now in Shortcuts create an automation that runs when Preview is opened, and select that shortcut you just created as its action. You may have to go into System Settings > Privacy & Security > Accessibility and let Shortcuts and siriactionsd access to control your desktop.

Basically, you're doing something very uncommon for a Mac desktop, so it's not going to help you with that by default. It doesn't mean you're powerless to change it, though!

1 comments

Thanks. Will give that a try.
Did it work? I’m dying of curiosity!
I don't have a Mac: I've had Macs in the past and plan to get another soon.

My "will give that a try" means that I put a link to your comment on a to-do list.

I demand instant gratification, darn it!

Heh, gotcha. I do hope it helps, though! Shortcuts is astoundingly powerful and I’ve used it for any number of personal nits like this. For example, combine it with Keyboard Maestro and you can add new commands to any app that’s scriptable via Shortcuts, like “if the current app is Notes, and I press F5, copy the current note and post its contents to Mastodon”, or whatever.