• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Extracting Text from aa Window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Extracting Text from aa Window
      • From: Matthew Stuckwisch <email@hidden>
References: 
 >Extracting Text from aa Window (From: Ronald Hofmann <email@hidden>)

  • Prev by Date: Re: SQL database and applescript?
  • Next by Date: Re: No error, No results....
  • Previous by thread: Re: Extracting Text from aa Window
  • Next by thread: Re: Extracting Text from aa Window
  • Index(es):
    • Date
    • Thread