• 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: list getting some item of variable (list)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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. |
----------------------------------------------------------------------


  • Prev by Date: Re: Offset vs. Repeat loops
  • Next by Date: Re: [Ann]: KinderShell.osax is now on www.osaxen.com
  • Previous by thread: list getting some item of variable (list)
  • Next by thread: Copy to clipboard
  • Index(es):
    • Date
    • Thread