Re: Creating/saving/appending to files the Cocoa way
Re: Creating/saving/appending to files the Cocoa way
- Subject: Re: Creating/saving/appending to files the Cocoa way
- From: Craig Williams <email@hidden>
- Date: Sun, 17 Jan 2010 18:13:38 -0700
On Jan 17, 2010, at 6:09 PM, Robert DuToit wrote:
> Hi John,
>
> It's not OBJ-C but I use 'echo' to write my log files...
>
> set somestring to "stat info"
> set filePath to (POSIX path of (path to desktop)) & "newfile.txt"
> set oldtext to do shell script "cat " & quoted form of filePath
> set newtext to oldtext & tab & somestring
> do shell script "echo " & newtext & " >" & quoted form of filePath
Hi Rob,
You don't need to use cat. The " > " overwrites the file but " >> " appends
to the end of the file.
Regards,
Craig
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden