Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Applescript to save a text file?



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.


References: 
 >Using Applescript to save a text file? (From: PiercyWorld <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.