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 16:01:46 -0500
- Thread-topic: Read/Write Text Files
Title: Re: Read/Write Text Files
On 4/1/10 3:55 PM, "Laine Lee" <email@hidden> wrote:
"Open for access" no longer appears to be needed for Leopard and Snow Leopard.
I forgot to send the part that illustrates this:
set folder_of_item to (path to preferences folder from user domain)
tell application "System Events"
set drec to "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict/>
</plist>"
set the plistfile_path to ((POSIX path of folder_of_item) & "/com.plist_scripting_example_with_a_really_long_name_so_I_can_spot_it_in_list_view.plist")
do shell script "touch" & space & plistfile_path
set startfile to (((folder_of_item as text) & "com.plist_scripting_example_with_a_really_long_name_so_I_can_spot_it_in_list_view.plist") as alias)
write drec to startfile starting at eof
set this_plistfile to (get property list file plistfile_path)
--set origval to (get value of property list item "mystring" of this_plistfile)
--get last property list item of this_plistfile
make new property list item at end of property list items of contents of this_plistfile with properties {kind:string, name:"first item", value:"first item value"}
--set value of property list item "first item" of contents of this_plistfile to "revised item 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