How-to obtain Long Name of Current User for Mac

(imported topic written by mkearns)

Hi Everyone,

Is there a way to obtain the long name (aka full name) of the current user on a Mac OS X system? Going through the Mac Inspector, I found “long name of process owner of client” which results in “System Administrator” - an expected outcome. While, “name of current user” outputs the shortname.

Thanks in advance!

(imported comment written by amelgares)

Try this:

following texts of last ":" of  (attributes "dsAttrTypeStandard:RealName" of users of logged on users as string)

(imported comment written by mkearns)

Thank you, amelgares. Your solution worked perfectly!

Hi @amelgares, can I have your assistance on checking below action fixlet… as i am running below action script to modifying the UFKeyServicesEnabled value under Library/Preferences/ByHost/com.apple.UFEN.8F76NDL8-8UY7-U76T-YYU43-JU65TY732T12.plist

The issue is that the value “8F76NDL8-8UY7-U76T-YYU43-JU65TY732T12” is not same for all devices… now i am running below script to fix the issue but unable to do so…

wait defaults write “/Users/{name of logged on user}/Library/Preferences/ByHost/com.apple.UFEN…plist” “UFKeyServicesEnabled” -int 0

But no luck… pls assist.