View on GitHub

Bannings的博客

[iOS developer:@"不能过目不忘,故撰文以记之"];

AppleScript 读写plist文件

framework   

--构建完整路径

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