AppleScript 读写plist文件

--构建完整路径

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

你可能感兴趣的:(分享,随笔,OS,X相关)