ec changed the topic of #elliottcable to: a π―ππ ππ π―πππππππππ π―ππππππ slash sΝΜuΝΝpΝΝeΜΜΊrΜΌΜ¦iΜΌΜoΜΜ¬rΜΜ cΜΝα»₯Μ§ΝαΈ·Μ‘ΝΕ£ΝΜ || #ELLIOTTCABLE is not about ELLIOTTCABLE
cloudhead has quit [Ping timeout: 260 seconds]
prophile has quit [Quit: The Game]
cloudhead has joined #elliottcable
fujisan has joined #elliottcable
cloudhead has quit [Ping timeout: 246 seconds]
mylesborins has quit [Quit: farewell for now]
mylesborins has joined #elliottcable
cloudhead has joined #elliottcable
kier has quit [Quit: No Ping reply in 180 seconds.]
kier has joined #elliottcable
cloudhead has quit [Quit: leaving]
Sgeo has joined #elliottcable
Sgeo_ has quit [Ping timeout: 240 seconds]
fujisan has quit [Quit: Connection closed for inactivity]
<ec>
hm
<ec>
I quite like the AirPods
<ec>
like, a lot more than expected
<gkatsev>
you should get your ears gauged then. It'll act as little cupholders/safetynets for them.
cloudhead has joined #elliottcable
<ec>
gkatsev: oh gods
<ec>
so fucking gross
<ljharb>
so like, you'd gauge your ears the way people install hooks onto the side of a door?
<ljharb>
"i need a place to hang stuff. this space isn't being used!"
<ec>
β¦ and thanks to you, I've now seen β¦ this.
<ec>
I mean, weird af β a lot of my JavaScript experience doesn't apply,
<ec>
but cool
<ljharb>
jxa?
<ec>
JavaScript for Automation
<jfhbrook>
wut
<ec>
it's the Open Scripting Architecture (the thing usually called AppleScript, as opposed to the *actual language* AppleScript), hooked up to a JavaScriptCore
<ec>
tl;dr write JS, automate your Mac
<jfhbrook>
oh that shit
<ec>
it's all stuff that's been possible for, like, a decade β¦ but it's just become *eeeeever* so slightly easier, just enough so to suddenly be within reach and popular :P
<jfhbrook>
that's kinda cool--I have a script that uses applescript somewhere but moar liek crapplescript amirite
<ec>
also it's kinda fun because it's JavaScriptCore. No multiple ancient browsers idiosyncrasies, no slow Node uptake β it's the equiv of Safari 10.1+, like, 100% of ES6, 60% of ES2016
<ec>
unfortunately there's not much fun stuff you can do with `async` or w/e, because β¦ oh snap, JXA is a fully synchronous environment. so far.
<ec>
buuuuuuut, since it's OSA, you can bridge out to basically anything available in Cocoa/ObjC ...
<ec>
hehehehe ...
<ec>
so I'm currently working on building asynchronicity in a synchronous javascript by jacking it up *from inside*
<ljharb>
oh right
<ljharb>
so like, JS for automator or whatever
<ljharb>
i just write applescript when i need to automate my mac :-p
<jfhbrook>
I write bash mostly
<ljharb>
bash can't automate mac app GUIs tho, only applescript and JS can do that
<jfhbrook>
haven't tried it in like 5 or 6 years, back when it sucked
<ec>
but AppleScript is extremely limited
<ec>
not *just* a bad language, there's lots it simply cannot do
<ec>
like take calling a shell-script: best case, you get *either* STDOUT *or* STDERR at the end β and you don't decide which β and sometimes, you get neither! non-deterministically! cool!
<ec>
JXA is all of the strengths of AppleScript *and* JavaScript *and* Cocoa (though detouring through Objective-C is ... less-than-fun)
<ec>
but unfortunately as a result of all that it's ... a bit of a frankensteinian horror
<ec>
so let's say you want to launch iTunes
<ec>
Application('iTunes').launch()
<ec>
coolio
<ec>
but what if I want to launch it in the background?
<ec>
also OSA objects are Fucking Weirdβ’, like, beyond DOM objects
<ec>
thanks to the OSA pedigree / the design it uses so AppleScript can be made AppleScript (because at some point that was apparently *desirable* to somebody),
<ec>
you can basically call any method of any OSA object on any other OSA object inside that application, and it will βjust workβ ... for sufficiently-unhinged values of βjust workβ
<ec>
so you can do like,
<ec>
Application('iTunes').currentTrack() gives you an OSA track-reference, right,
<ec>
but β¦ Application('iTunes').artist()????? would also work?????????
<ec>
i'm too terrified of what eldritch horrors that might summon and/or what it might do to the nature of local spacetime to actually go run it and find out, but I've seen plenty of examples like that inexplicably Do Something.
<ec>
but meanwhile some of the things an old JavaScript hand would think are straightforward will explode
<ec>
for instance don't you dare type Application('iTunes') into a REPL of some sort that might try to enumerate its members or serialise it in any way O_O
<ec>
and Object.getPrototypeOf( Application('iTunes') ) will straight segfault Safari
<ec>
*not just the JXA JavaScriptCore*, like, my fucking browser, opened to the documentation
<ec>
p. sure JXA exhibits hyper-nonlocal real behaviour
<ec>
haha ignore me I have no idea what's going on i'm v. sure it's all user error
<ec>
but nonetheless I am constantly spooked by how familiar and yet foreign it is to be working in such a Wildly Different environment. getting some srs JavaScript Uncanny Valley here.
krainboltgreene_ has joined #elliottcable
vil has quit [Ping timeout: 240 seconds]
krainboltgreene has quit [Ping timeout: 240 seconds]