In AppleScript, you can do something like:
set username to short user name of (system info)
set computername to host name of (system info)
set ethernet to primary Ethernet address of (system info)
set ipaddress to IPv4 address of (system info)
set osver to system version of (system info)
I'm not sure how I can access system info object. How do I do this in JXA (JavaScript AppleScript)? Thanks!