• 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: move the contents of a document into a variable/record...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: move the contents of a document into a variable/record...


  • Subject: Re: move the contents of a document into a variable/record...
  • From: Michelle Steiner <email@hidden>
  • Date: Mon, 20 Nov 2000 14:07:34 -0800

On 11/20/00 1:48 PM, Jim Bob Support <email@hidden> wrote

>i have a simple text file that contains one long string, something like
>this...
>
>{RecordID:1234, Docket:4312, CompanyName:"Fred's Garage", Quantity:10}
>
>...normally i would open BBEdit and copy the contents of the document into a
>variable/Record.
>
>i would like to know if i can simply transfer the contents of the document
>into the variable/record without using an application like BBEdit to serve as
>a conduit.
>
>is this possible ?

You can get the data into a variable very easily, like this:

set x to choose file
open for access x
set y to read x
close access x
if the last character of y is return then set y to text 1 through -2 of y

The last line is there because whenever I saved a BBEdit document, it
kept adding a carriage return to the content.

--Michelle

----------------------------------------------------------------------
| Michelle Steiner | Hard as it may be to believe, my |
| email@hidden | life has been based on a true story. |
----------------------------------------------------------------------


  • Prev by Date: move the contents of a document into a variable/record...
  • Next by Date: RE: applescript novice
  • Previous by thread: Re: move the contents of a document into a variable/record...
  • Next by thread: Re: move the contents of a document into a variable/record...
  • Index(es):
    • Date
    • Thread