Re: Extracting Text from aa Window
Re: Extracting Text from aa Window
- Subject: Re: Extracting Text from aa Window
- From: Matthew Stuckwisch <email@hidden>
- Date: Sun, 31 Mar 2002 10:15:23 -0600
How can I save a text contained in a variable to my disk?
How can I load a textfile from my disk into a variable?
Heh, well, I've forgotten how to do save data, but I remember how to read
it (two ways, actually)
on readFile(fileLoc)
set theReturn to do shell script "more " & (fileLoc as string)
--OR
set theReturn to (get fileLoc as alias)
end readFile
A note on each: the shell script method must replace each " " in fileLoc
with "\ " first. It will never generate an error per se, do an if/then
block afterwards (check for "No such file or directory" at the end of the
string). The "traditional" way will though, so use an on error block, it
will generate an error if the file doesn't exist.
I'll see if after breakfast I can't possibly remember how to save a file
(hunger does that, eh?), if not I'll play around to come up with something
(unless someone recalls off the top of their heads)
Matthew Stuckwisch
[AIM/MSN]{GuifaSwimmer} | [Yahoo!]{SapphireTree} | [ICQ]{137477701}
[IRC]{guifa / G}(esperNET / irc.massinova.com)
_______________________________________________
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.