<     May 2017     >
Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6  
 7  8  9 10 11 12 13  
14 15 16 17 18 19 20  
21 22 23 24 25 26 27  
_2_8 29 30 31
08:45 cloudhead joined
09:55 fujisan joined
10:25 mylesborins joined
11:48 cloudhead joined
12:08 kier joined
15:36 Sgeo joined
19:57 <ec> hm
19:57 <ec> I quite like the AirPods
19:57 <ec> like, a lot more than expected
19:57 <gkatsev> you should get your ears gauged then. It'll act as little cupholders/safetynets for them.
21:04 cloudhead joined
21:34 <ec> gkatsev: oh gods
21:35 <ec> so fucking gross
21:35 <ljharb> so like, you'd gauge your ears the way people install hooks onto the side of a door?
21:35 <ljharb> "i need a place to hang stuff. this space isn't being used!"
21:35 <ec> … and thanks to you, I've now seen … this.
21:35 <ec> http://imgur.com/YwzL9j9
21:36 <ljharb> lol
21:37 <ec> JXA is very cool
21:37 <ec> I mean, weird af — a lot of my JavaScript experience doesn't apply,
21:37 <ec> but cool
21:38 <ljharb> jxa?
21:41 <ec> JavaScript for Automation
21:42 <jfhbrook> wut
21:42 <ec> it's the Open Scripting Architecture (the thing usually called AppleScript, as opposed to the *actual language* AppleScript), hooked up to a JavaScriptCore
21:42 <ec> tl;dr write JS, automate your Mac
21:42 <jfhbrook> oh that shit
21:42 <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
21:42 <jfhbrook> that's kinda cool--I have a script that uses applescript somewhere but moar liek crapplescript amirite
21:43 <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
21:44 <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.
21:44 <ec> buuuuuuut, since it's OSA, you can bridge out to basically anything available in Cocoa/ObjC ...
21:44 <ec> hehehehe ...
21:45 <ec> so I'm currently working on building asynchronicity in a synchronous javascript by jacking it up *from inside*
21:53 <ljharb> oh right
21:53 <ljharb> so like, JS for automator or whatever
21:53 <ljharb> i just write applescript when i need to automate my mac :-p
21:58 <jfhbrook> I write bash mostly
21:58 <ljharb> bash can't automate mac app GUIs tho, only applescript and JS can do that
21:59 <jfhbrook> or sikuli
21:59 <ljharb> ?
21:59 <jfhbrook> http://www.sikuli.org/
21:59 <jfhbrook> really really cool idea
21:59 <jfhbrook> haven't tried it in like 5 or 6 years, back when it sucked
22:07 <ec> but AppleScript is extremely limited
22:07 <ec> not *just* a bad language, there's lots it simply cannot do
22:08 <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!
22:08 <ec> JXA is all of the strengths of AppleScript *and* JavaScript *and* Cocoa (though detouring through Objective-C is ... less-than-fun)
22:09 <ec> but unfortunately as a result of all that it's ... a bit of a frankensteinian horror
22:09 <ec> so let's say you want to launch iTunes
22:09 <ec> Application('iTunes').launch()
22:09 <ec> coolio
22:09 <ec> but what if I want to launch it in the background?
22:10 <ec> ObjC.import('AppKit')
22:10 <ec> $.NSWorkspace.sharedWorkspace.launchAppWithBundleIdentifierOptionsAdditionalEventParamDescriptorLaunchIdentifier(
22:10 <ec> 'com.apple.iTunes', $.NSWorkspaceLaunchAsync | $.NSWorkspaceLaunchAndHide, $.NSAppleEventDescriptor.nullDescriptor, null)
22:10 <ec> lololol
22:11 <ec> also OSA objects are Fucking Weird™, like, beyond DOM objects
22:11 <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),
22:12 <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”
22:12 <ec> so you can do like,
22:12 <ec> Application('iTunes').currentTrack() gives you an OSA track-reference, right,
22:13 <ec> Application('iTunes').currentTrack().name(), Application('iTunes').currentTrack().artist()
22:13 <ec> but … Application('iTunes').artist()????? would also work?????????
22:13 <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.
22:14 <ec> but meanwhile some of the things an old JavaScript hand would think are straightforward will explode
22:14 <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
22:15 <ec> and Object.getPrototypeOf( Application('iTunes') ) will straight segfault Safari
22:15 <ec> *not just the JXA JavaScriptCore*, like, my fucking browser, opened to the documentation
22:16 <ec> p. sure JXA exhibits hyper-nonlocal real behaviour
22:16 <ec> haha ignore me I have no idea what's going on i'm v. sure it's all user error
22:17 <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.
22:23 krainboltgreene_ joined
22:28 ^il joined
22:56 <gkatsev> ec: ljharb: yup, http://imgur.com/YwzL9j9 is exactly what I meant, lol