Get user picture from Address Book

Hi!

I ´m trying to get the picture of the current user. All contact pictures of the Address Book are stored in ~/Library/Application Support/AddressBook/Images/. But I cannot find the picture of “Me”.
Anybody knows where I can find the picture of me?

Thanks for your help.

Greetings, hoschy07.

I don’t know if this is generally true, but on my machine, “me” is the picture I use as the login image.

Thank you Adam for your reply.
Do you know where the login image is stored?

Hi hoshy07,

as far as I know your user picture is stored in:

/Library/Caches/com.apple.userYourUID*pictureCache.userImage

  • you can get your user id with the shell command id -u

D.

Try this, hoschy:

tell application "System Events" to current user's picture path

Where do you discover this stuff? [and how do you view it]

In this case Adam, the System Events AppleScript dictionary offers a couple of clues - albeit not very obvious ones. One part, current user, is listed as an application property in the System Events Suite. The other, picture path, appears in the Accounts Suite as a user property.

You mean the picture? Try something like this:

tell application "System Events" to set p to current user's picture path
tell application "Preview" to open (POSIX file p as alias)

:slight_smile:

Ahhh - POSIX file p as alias. I tried quite a few other variations but got largely meaningless (to me) error messages.

Thanks