Hacker News new | past | comments | ask | show | jobs | submit login

I haven't tried BeOS/HaikuOS or the hey tool, but I've used the equivalent on macOS. The hey language seems a bit awkward to me, just like AppleScript. A few years back Apple added JavaScript support for OSA, which was a huge win for me. It took me a while to learn how to navigate the docs and use the APIs, but it's proven to be incredibly powerful.

Over time I've built up a small list of utilities for common UI interactions. Here's an example: Get the list of tabs from the frontmost Safari window [0]. Occasionally I'll be researching some topic with a bunch of tabs open, and I want to go work on something else. When that happens I just grab all the URLs in that window and save it in a text file which I re-open later when I want to continue researching the subject.

IMO, the biggest problem I've encountered with OSA scripts (and presumably it also applies to this hey tool) the lack of REPL and inspector. On macOS you can use Safari's dev tools to debug JS OSA scripts, but it's incredibly brittle. Trying to access certain object properties will just cause it to crash, or it might print the identifier of the thing which you're accessing which doesn't add much value.

[0] https://gist.github.com/cesarandreu/8d6ccd70bcac81d1a45941ae...




The "hey" tool itself is just a command-line interface to the messaging/scripting system built into the Haiku interface kit (that it's essentially built around). Someone once wrote a module for Python to interface with it as well (although it's ancient and I doubt it works with modern Python: https://github.com/HaikuArchives/HeyModule).

And of course there is the Hey source itself, which you could use as a reference to write a new scripting platform with (https://github.com/haiku/haiku/blob/master/src/bin/hey.cpp).


I understand not fixing something if it isn't broken, but is there a reason you don't just use a "Bookmark Open Pages" feature? I'm pretty sure it's standard in the big browsers, but definitely on chrome.


I just checked with Safari and it does indeed provide that functionality, and I wasn't aware it was an option.

Honestly, I just find it convenient to get a list of URLs, and dealing with regular text files. Sometimes interfaces are too limiting r slow, and manipulating the list in a text editor ends up being easier.

Another of my use-cases for this is to regroup tabs when I fork into random topics. e.g. Sometimes I end up opening a bunch of tabs that are tangentially related to the subject and I want to move em into a new window or stash em for later.

It's also convenient to grab a manually opened list of URLs in cases where I want to perform some one-off scraping task.


I do something similar with Hammerspoon on MacOS, which allows you to do all of this stuff, albeit with the Lua programming language (which I find far more elegant than anything else) ..

Its gotten to the point that I can't seem to really function on a new MacOS installation without my personal Hammerspoon repo set up .. I'm not sure if thats a positive or a negative result of having such deeply scriptable interfaces, but perhaps it can be looked at both ways.

http://www.hammerspoon.org




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: