• 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
logging to a file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

logging to a file?


  • Subject: logging to a file?
  • From: Aaron Rosenblum <email@hidden>
  • Date: Fri, 12 Nov 2004 18:52:49 -0500

Hey all,

Two quick questions. I have this code that I want to log to a file. (Basically like NSLog) How do I insert a newline at the end of the line I am writing to a file, and also how to I dynamically resolve the path to the users home folder instead of hard coding it.

sorry if these are simple questions, but im an AS newbie...

Aaron

set theTargetFile to ("Macintosh HD:Users:myuser:output.txt" as string) as file specification
try
open for access theTargetFile with write permission
write ((current date) & "Working on " & this_item as string) to theTargetFile starting at eof
close access theTargetFile
end try


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: logging to a file?
      • From: Gnarlodious <email@hidden>
  • Prev by Date: Re: strcat in applescript?
  • Next by Date: Re: logging to a file?
  • Previous by thread: Re: Count lines
  • Next by thread: Re: logging to a file?
  • Index(es):
    • Date
    • Thread