osa2 icon indicating copy to clipboard operation
osa2 copied to clipboard

stdlib not found on macOS Mojave Beta (18A293u)

Open acenqiu opened this issue 6 years ago • 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)

acenqiu avatar Jun 05 '18 09:06 acenqiu

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

dnicolson avatar Aug 24 '20 19:08 dnicolson