Remix.run Logo
kbd 7 hours ago

What can you do on a Mac with Shortcuts vs AppleScript vs Hammerspoon?

alin23 7 hours ago | parent | next [-]

There are some things that are only available in Shortcuts because Apple gave the app entitlements to communicate with parts of the system that an AppleScript or other apps can't. Things like setting/getting the Focus Mode, changing some system settings like Airdrop Receiving, Color Filters, Background Sounds etc.

Also some apps export Shortcut actions that can run in-app code: for example my Lunar app has an action that can help fixing arrangement when monitors flip around [1]

It's much easier to implement a struct for a Shortcut, than exporting AppleScript sdef files or creating IPC command-line tools, so a lot of apps take this route for code that needs access to the memory of the running app.

[1] https://lunar.fyi/shortcuts#fix-monitor-arrangement

_doctor_love 6 hours ago | parent [-]

I didn't realize you were the Lunar guy! I freaking love your apps! Thank you for making good and useful software.

Being able to adjust my monitor brightness during the pandemic actively changed my quality of life for the better (I was in a small SF apartment).

alin23 5 hours ago | parent [-]

Thank you for the kind words! Love to hear from people that were helped by my work!

That was also my pain point with Lunar, working on a small balcony in a small apartment where the light from the window was constantly changing and the monitor always being way too bright or way too dim.

I broke one of those LG monitor joystick OSD buttons before I got to building Lunar.

hrmtst93837 5 hours ago | parent | prev [-]

Apple designed Shortcuts to look like a shiny toy demo, and it gets awkward fast once you leave the happy path. AppleScript is old, weird, and still wired into a lot of Mac apps, but the moment it trips over something basic like text encoding you can lose an hour digging through forum posts from 2004.

With Hammerspoon, you get Lua and direct macOS APIs, so you can push much further if you don't mind writing more glue code. If you care about serious Mac automation, you'll probably mix them and curse each one for a different reason.

criddell 5 hours ago | parent | next [-]

> Apple designed Shortcuts to look like a shiny toy demo

Apple bought Workflow from DeskConnect (they may have bough the entire company).

hirvi74 3 hours ago | parent | prev [-]

> If you care about serious Mac automation, you'll probably mix them and curse each one for a different reason.

I do. I completely left all of the automation options. I just use Swift and the private macOS APIs. Though, I will admit that there are still some things that Shortcuts can do that I have not found a to hack around in Swift. The difference is likely due to App Intents, which is big lame.