Re: move the contents of a document into a variable/record...
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. |
----------------------------------------------------------------------