Re: Read/Write Text Files
Re: Read/Write Text Files
- Subject: Re: Read/Write Text Files
- From: Laine Lee <email@hidden>
- Date: Thu, 01 Apr 2010 15:55:48 -0500
- Thread-topic: Read/Write Text Files
Title: Re: Read/Write Text Files
"Open for access" no longer appears to be needed for Leopard and Snow Leopard.
set prefsFolder to (path to preferences folder from user domain)
set posixPath to (POSIX path of prefsFolder)
set prefsName to "com.plist_scripting_example_with_a_really_long_name_so_I_can_spot_it_in_list_view"
do shell script "defaults write " & posixPath & prefsName & " \"first item\" \"first item's value\""
set the plistfile_path to ((POSIX path of prefsFolder) & prefsName & ".plist")
tell application "System Events"
set this_plistfile to (get property list file plistfile_path)
if (get value of property list item "first item" of contents of this_plistfile) is not "revised item value" then
set value of property list item "first item" of contents of this_plistfile to "revised item value"
end if
make new property list item at end of property list items of contents of this_plistfile with properties {kind:string, name:"second item", value:"second item's value"}
end tell
Laine Lee
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden