When I run:
tell application "System Events"
get the properties of the current user
end tell
in applescript, everything looks fine except for the picture path. The path referenced is not what I see as my user picture.
I am probably missing something here, but I do not know what. Does the picture in the path referenced serve another purpose than the picture that I set to be my User Picture in System Preferences?
Thanks!
In short
account image is 'JPEGPhoto' attribute of user record and
get the properties of the current useris returning 'Picture' attribute of user record.Mac OS X 10.5+ stores user's account pictures within the Directory Service. User account contains a 'Picture'(that is a path to the account pictures) and 'JPEGPhoto' attribute in their user record .This can be read using the
dsclcommand (dscl . -read /Users/username Pictureanddscl . -read /Users/username JPEGPhoto | tail -1 | xxd -r -p > /accountImage.jpg).(initially both are same)If a user has modified their user picture at any time using
system preferencesthe account picture is stored in the 'JPEGPhoto' attribute of their user record not in 'Picture' attribute.If a user has modified their user picture at any time using
applescriptthe account picture is stored in the 'Picture' attribute of their user record not in 'JPEGPhoto' attribute.Your
applescriptis returning 'Picture' attribute of user record.Reference:
Where does the Mac store account pictures?