Hi š
Iāve been mucking about with obb a bit and hit something odd, it seems prn goes to std error (my unix-fu is not very strong so I might not be doing the redirection correctly):
⯠obb -e '(prn "goes to error")' > out 2> error
⯠cat error
"goes to error"
⯠cat out
nil
⯠obb --version
obb v0.0.3
Ah, I faintly remember this.
I think the thing to do would be to check if JavaScript has the same behavior.
quick off the mark!
will doā¦
Might be a weird quirk of OSA.
Hope youāre having fun with obb!
Youāre right, JS does indeed end up in std errro⦠š
Fun!
yeah, that is certainly a⦠strange design decision
OSA is this weird, mostly forgotten corner of macOS.
Can I ask what youāre thinking of using obb for?
Sure, itās a bit roundabout: Iām using it to really explore available options in plain JXA. Once Iāve got it down with obb Iām translating to JXA as it executes faster than the whole of Clojurescript + obb. In terms of why⦠Iām mucking about with turning Emacs into a Spotlight/Alfred/Raycast like tool, for e.g., I can hit a key in Safari which copies the title and URL and opens up a floating Emacs frame with Org capture for taking notes
Whoa!
That sounds rad.
Iām between jobs š
Funemployed!
Iāve got all the bits and pieces working and a few example commands⦠now Iām trying to nail down the best way to script MacOS⦠youāre right, Apple really have seemed to abandoned MacOS scripting⦠Interestingly you can script in Swift with just a shebang but itās not as user friendly as JXA or AppleScript
> Iām translating to JXA as it executes faster than the whole of Clojurescript + obb. Do you mean in terms of startup time of performance?
yeah, obb is about 200ms for something simple my side (I can get the numbers Iām just pulling off the top of my head)
you still didn't say which
oh right, did you mean āstartup time or performanceā?
yes
startup
got it
Iām guessing it has to compile the whole of CLJS per execution?
well, obb uses SCI and SCI yields about 1mb of JS. The OSAscript thing isn't the most optimized one I guess. With nbb (Node.js) I have about 100ms of startup time
yeah, sorry meant SCI + clojure.core
I wonder if #cherry or #squint would work for OSAScript. They are compiled and smaller (squint yields the smallest)
good call
I don't know if osascript supports es6 though
mmm, Iāll probably just go back to JXA for these little bridge scripts
yeah
I even prefer Emacs Lisp to JS though!
BTW during benchmarking simple scripts nothing I can find beats bb š
not even compiled (second+ run) Swift scripts