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: Andrew Oliver <email@hidden>
- Date: Tue, 27 Apr 2004 14:41:32 -0700
Why would it work. You're trying to open a string.
>
set my_log to "This file can not be opened by this program. Please try another
format. Thank You!"
>
open for access my_log
'open for access' requires a file path to open. You then write to the file:
set my_log to "here's the message to write to the file"
set my_log_file to open for access file "path:to:log:file.txt" with write
permission -- this opens the file
write my_log to my_log_file starting at EOF -- append to the end
close access my_log_file -- close the file when you're done
Andrew
:)
On 4/27/04 2:21 PM, "PiercyWorld" <email@hidden> wrote:
>
I would like to save a file as a text document in Applescript but I
>
cannot figure it out.
>
>
I would like to....
>
>
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"
>
>
But it doesn't seem to work. Can anyone help?
>
>
Thank you!
>
>
Vic Piercy
>
_______________________________________________
>
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.
_______________________________________________
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.