Re: list getting some item of variable (list)
Re: list getting some item of variable (list)
- Subject: Re: list getting some item of variable (list)
- From: Michelle Steiner <email@hidden>
- Date: Sun, 8 Jul 2001 17:44:11 -0700
On 7/7/01 8:42 AM, monk <email@hidden> wrote:
>
hi again scriptheads:
>
>
whenever i try to:
>
>
get some item of myvar
>
>
where myvar is a text file, has been opened for access and read as list
>
using delimiter space
>
>
i get an error such as can't read 622, the marker for myvar
>
>
what am i doing wrong?
You have to read the text into a variable and get some item of the
variable.
Also, you don't need "as list" because "some item" will work with a
string as well as with a list.
tell application "Finder"
set foo to item 1 of the selection
end tell
set myvar to open for access foo
set myitems to read myvar using delimiter space -- as list
set randomitem to some item of myitems
close access myvar
randomitem
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------