applescript中当前用户图片路径的奇怪属性结果

applescript中当前用户图片路径的奇怪属性结果,applescript,system-preferences,dscl,Applescript,System Preferences,Dscl,当我跑步时: tell application "System Events" get the properties of the current user end tell 在applescript中,除了图片路径之外,所有内容都看起来很好。引用的路径不是我所看到的用户图片 我可能在这里遗漏了什么,但我不知道是什么。参考路径中的图片是否有其他用途,而不是我在系统首选项中设置为用户图片的图片 谢谢 简而言之 帐户图像是用户记录的“JPEGPhoto”属性,获取当前用户的属性返回用户记录的

当我跑步时:

tell application "System Events"
   get the properties of the current user
end tell
在applescript中,除了图片路径之外,所有内容都看起来很好。引用的路径不是我所看到的用户图片

我可能在这里遗漏了什么,但我不知道是什么。参考路径中的图片是否有其他用途,而不是我在系统首选项中设置为用户图片的图片

谢谢

简而言之

帐户图像是用户记录的“JPEGPhoto”属性,
获取当前用户的属性
返回用户记录的“Picture”属性

Mac OS X 10.5+在目录服务中存储用户的帐户图片。用户帐户在其用户记录中包含“图片”(即帐户图片的路径)和“JPEGPhoto”属性。可以使用
dscl
命令(
dscl.-read/Users/username-Picture
dscl.-read/Users/username-JPEGPhoto | tail-1 | xxd-r-p>/accountImage.jpg
)读取此属性。(最初两者相同)

如果用户在任何时候使用
系统首选项
修改了其用户图片,则帐户图片将存储在其用户记录的“
JPEGPhoto
”属性中,而不是“
picture
”属性中

tell application "System Events"
    set the picture path of current user to "/Library/User Pictures/Flowers/Dahlia.tif"
end tell  
如果用户在任何时候使用
applescript
修改了其用户图片,则帐户图片将存储在其用户记录的“
picture
”属性中,而不是“
JPEGPhoto
”属性中

tell application "System Events"
    set the picture path of current user to "/Library/User Pictures/Flowers/Dahlia.tif"
end tell  
您的
applescript
正在返回用户记录的“
Picture
”属性

参考资料:
简而言之

帐户图像是用户记录的“JPEGPhoto”属性,
获取当前用户的属性
返回用户记录的“Picture”属性

Mac OS X 10.5+在目录服务中存储用户帐户图片。用户帐户在其用户记录中包含“图片”(即帐户图片的路径)和“JPEGPhoto”属性。这可以使用
dscl
命令读取(
dscl.-read/Users/username Picture
dscl.-read/Users/username JPEGPhoto | tail-1 | xxd-r-p>/accountImage.jpg
)(最初两者相同)

如果用户在任何时候使用
系统首选项
修改了其用户图片,则帐户图片将存储在其用户记录的“
JPEGPhoto
”属性中,而不是“
picture
”属性中

tell application "System Events"
    set the picture path of current user to "/Library/User Pictures/Flowers/Dahlia.tif"
end tell  
如果用户在任何时候使用
applescript
修改了其用户图片,则帐户图片将存储在其用户记录的“
picture
”属性中,而不是“
JPEGPhoto
”属性中

tell application "System Events"
    set the picture path of current user to "/Library/User Pictures/Flowers/Dahlia.tif"
end tell  
您的
applescript
正在返回用户记录的“
Picture
”属性

参考资料:

在Mac OS X版本10.7.4中,DirectoryService已被opendirectoryd(8)取代。我正在运行10.7.4,第二个dscl命令返回了我的用户图片。第一个命令返回的图片与系统事件命令相同,这是错误的。帐户图像是用户记录的“JPEGPhoto”属性。在Mac OS X版本10.7.4中,DirectoryService已被opendirectoryd(8)替换.我正在运行10.7.4,第二个dscl命令返回了我的用户图片。第一个命令返回的图片与系统事件命令相同,这是错误的。帐户图像是用户记录的“JPEGPhoto”属性。