Adding extra security in Javascipt for Indesign
I wrote the below code to get username + hostname within Indesign. Works on windows but doesnt work on mac. It justs brings back username@null.
I assume its not possible to get hostname through Indesign. But can someone offer a solution or direct me to the right place. My goal is to limit the scripts I wrote to a specific computer with a unique identifier. If I can only do it with username than I guess that would have to do.
Any suggestion would be very helpful. Thank you
var userName = $.getenv("USERNAME") || $.getenv("USER"); // For Windows/macOS
var computerName = $.getenv("COMPUTERNAME") || $.getenv("HOSTNAME");
var uid = userName + "@" + computerName;
alert("Detected UID:\n" + uid);
