AppleScript 读写plist文件

来源:互联网 发布:php上传图片缩略图 编辑:程序博客网 时间:2024/05/29 04:32

--构建完整路径

set filePath to ("" & (path to library folder from user domain) & "Preferences" & ":com.eusoft.eudic.plist")

--转为unix路径

set plistPath to POSIX path of filePath

tell application "System Events"

--方法一

(*

tell property list file plistPath

set value of property list item "MAIN_TimesLeft" to "820711"

end tell

*)

--方法二

set plist to property list file plistPath

set value of property list item "MAIN_TimesLeft"of plist to "820711"

end tell

原创粉丝点击