wtfaremyinitials/osa2

stdlib not found on macOS Mojave Beta (18A293u)

acenqiu opened this issue · 1 comments

execution error: Error on line 2: Error: nothing found to import (-2700)

Possible workaround:

ObjC.import('Foundation')
var fn   = (${fn.toString()})
var args = JSON.parse(ObjC.unwrap($.NSProcessInfo.processInfo.environment.objectForKey("OSA_ARGS")))
var out  = fn.apply(null, args)
JSON.stringify(out)

Ironically $.NSProcessInfo is undefined in the Big Sur betas and doing the reverse works: JXA-userland/JXA#24.