Hi,
I need help … While I thought I had found a way to determine, at a specific moment, who were the active (frontmost user) and the current user (the user where a specific script is executed), I am maybe wrong. The statements to check who are these users are:
tell application “Finder” to set activeUserName to do shell script “stat -f ‘%Su’ /dev/console”
tell application “System Events” to set currentUserName to name of current user
get {activeUserName, currentUserName}
While this script gave consistent results and worked perfectly and resisted many tests for many days, this morning things went wrong. While I know, from being in front of the computer, that the active user is User1, the script’s result is now “root”. The current user’s result is OK.
Is my first statement good ?
Thanks in advance.
Robert