Read / Write with Files
Read / Write with Files
- Subject: Read / Write with Files
- From: Andersen Studley <email@hidden>
- Date: Wed, 30 Jun 2004 15:10:13 -0700
First off, thanks to Tom for his reply that helped me get going.
Have a couple more specific questions now...
I'm trying to inject text at a certain place in a text file. I had
hoped to be able to scan up to a unique set of characters and use that
as my insertion point, but the only command I've found that sounds like
it would work is read and it only searches for a single character
read: Read data from a file that has been opened for access
read anything -- the reference number, alias, or file reference of
the file to read
[until plain text] -- or read up to and including this character
Is there anyway to find out which characters are permissible? In my
test script I tried to use some of the "special" characters so that
they would be unique, but they were skipped over.
What is the newline character? Putting in "\n" simply dropped my code
down a line without affecting my position in the file.
More troublesome, however, is that write myContent to myFile
stomps over whatever was there. for example, if I have a file
contain containing "I ran tonight" and want to insert "fast" into it,
I end up with "I ran fastght"
Am I missing better commands for these two functions? Any advice would
be appreciated
Andersen Studley
_______________________________________________
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.