Re: Using Applescript to save a text file?
Re: Using Applescript to save a text file?
- Subject: Re: Using Applescript to save a text file?
- From: Dave Balderstone <email@hidden>
- Date: Tue, 27 Apr 2004 16:10:14 -0600
On 27-Apr-04, at 3:21 PM, PiercyWorld wrote:
set my_log to "This file can not be opened by this program. Please try
another format. Thank You!"
open for access my_log
save as file my_log to (path to desktop) as "log.txt"
Compare the above with the below
----
set _TempFile to ((path to desktop) & "log.txt") as text
set _Text to "This file can not be opened by this program. Please try
another format. Thank You!"
try
close access file _TempFile -- Make sure the file wasn't accidentally
left open
end try
open for access file _TempFile with write permission
set eof file _TempFile to 0 -- clear the file contents
write _Text to file _TempFile starting at eof
close access file _TempFile
----
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.