|
|
|
|
|
by gmanley
1954 days ago
|
|
I haven't found much I couldn't script using built in automation [1] or if it's lower level one of the LUA based scripting tools like hammerspoon [2]. Mac automation is really robust. Even just the default provided tools like Automator or scripting GUI tasks via Javascript/Applescript can accomplish a lot. Using a tool like Alfred [3] and having "workflows" attached to hotkeys for automated things works wonders. For example I have a "workflow" that lets me hit a hotkey on a playing video and it automatically creates a bookmark at that timestamp which is recorded to a SQLite DB. Any future times I open that video I get a list of bookmarks and the ability to jump to them. This script marks all the currently selected songs in iTunes as loved or the currently playing song as loved. [4] I have a lot to complain about Mac/MacOS and the direction it's gone down recently, been using Mac since OSX came out, but automation isn't one of them. Out of curiosity what did you try to automate that you couldn't? [1] https://developer.apple.com/library/archive/documentation/La... [2] http://www.hammerspoon.org [3] https://www.alfredapp.com [4] https://gist.github.com/gmanley/750426aa91097aeef3aee5a73a1f... |
|
Most things I've tried and failed to do involve silent/background interaction with apps. For example, my company's VPN software doesn't handle sleep well at all, so I wanted to automatically disconnect before sleeping. I couldn't work out how to do it. The Mac Automation stuff (Automator and AppleScript) work if the app supports them, but my experience has been that support isn't necessarily reliable. Electron apps, at least, ignored my attempts last time I tried.
I figured out a way to do things using keyboard/mouse automation, but that fails in any context where I'm either actively doing something or where input isn't being accepted (e.g. when the lid is closed or when I'm actively editing code). On Linux I can at generally resort to Stupid X11 Hackery to make that kind of thing happen, though it sometimes needs WM integration if the app isn't cooperating.