I need to be able to get the user homedirectory, i.e. %userprofile% for win32 and $home for mac, if this is possible.
I was pointed to the $.process but not sure if it supports .env for environment variable. I want to do something like:
process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'];
but, I get undefined for $.process.env, so possible that it is not supported.
JB pointed out something similar in: https://forum.archimatetool.com/index.php?topic=854.msg4709#msg4709 (https://forum.archimatetool.com/index.php?topic=854.msg4709#msg4709)
The following should do the trick:
console.log("New Archi Script");
var System = Java.type('java.lang.System');
console.log(System.getProperty("user.home"));
console.log(System.getenv("USERPROFILE"));
Thanks PN9, this worked a treat