Get nick name of current user I want to get the nickname of the currently logged in OS X user via Apple Script. Currently can only retrieve the full name or the nickname of a contact, I wasn't able to combine the two scripts.

tell application "System Events"
    get full name of current user
end tell


Returns my full name.

tell application "Contacts" to get nickname of person "My Name"

Returns my nickname.

I'd like to get the nickname of the vcard of the currently logged in user.
I've managed to solve it quite o.k.

tell application "Contacts"
    tell application "System Events"
        set theName to full name of current user
    end tell
    set theNick to nickname of person theName
    if theNick is not missing value then
        return theNick
    else
        return word 1 of theName
    end if
end tell


It would be better to select the vcard associated with the user account and not just match the name. But I couldn't find out how to do this.