• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Creating/saving/appending to files the Cocoa way
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Creating/saving/appending to files the Cocoa way (From: "John C. Welch" <email@hidden>)
 >Re: Creating/saving/appending to files the Cocoa way (From: Robert DuToit <email@hidden>)

  • Prev by Date: Re: Creating/saving/appending to files the Cocoa way
  • Next by Date: Re: Creating/saving/appending to files the Cocoa way
  • Previous by thread: Re: Creating/saving/appending to files the Cocoa way
  • Next by thread: Re: Creating/saving/appending to files the Cocoa way
  • Index(es):
    • Date
    • Thread