Re: creating temp files??
Re: creating temp files??
- Subject: Re: creating temp files??
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 11 Jun 2003 20:40:45 -0700
On 6/11/03 6:23 PM, "Chris Kacerguis" <email@hidden> wrote:
>
I'm a UNIX programmer (C++, Perl, PHP, etc) for a living, however I have
>
never used, seen, or written an AppleScript program...script...whatever.
>
>
So I decided to write a script, and for the most part I have figured out
>
how things work. However, I am writting a program that takes a variable
>
reads it into a temp file, then I need to know the file name and location,
>
then send that file name to a:
>
>
do shell script ("command <" & filename)
>
>
So my question is:
>
>
How do I make a temp file (just needs to be plain old text)
>
>
the file is in a loop, so the file would either need to be deleted, or
>
over written each loop iteration.
>
>
Can someone PLEASE help!
Check the read, write and open for access commands in Standard Additions in
/System/Library/ScriptingAdditions:
set f to open for access file filePath with write permission
set eof f to 0
write "some text" to f
close access f
Note 'file filePath'. You can use 'alias filePath' if it already exists, but
'file filePath' creates the file if it doesn't exist yet. Use
colon-delimited format for file paths. You can put all that in a loop. 'set
eof f to 0' allows you enables overwriting. You can use a variable, of
course, for "some text" and it can be string or Unicode text (or various
other types of data, if specified). If you write Unicode and ever need to
read it back by script, make sure to
set r to read f as Unicode text
--
Paul Berkowitz
_______________________________________________
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.