Re: logging to a file?
Re: logging to a file?
- Subject: Re: logging to a file?
- From: kai <email@hidden>
- Date: Sat, 13 Nov 2004 00:28:10 +0000
On Fri, 12 Nov 2004 18:52:49 -0500, Aaron Rosenblum wrote:
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
-----------------
set theTargetFile to (path to "cusr" as Unicode text) & "output.txt"
set f to open for access file theTargetFile with write permission
write return & (current date) & ". Working on " & this_item to f
starting at eof
close access f
-----------------
---
kai
_______________________________________________
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