• 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: Reading Text File in only produces one item as list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading Text File in only produces one item as list


  • Subject: Re: Reading Text File in only produces one item as list
  • From: Michelle Steiner <email@hidden>
  • Date: Fri, 20 Jul 2007 11:42:53 -0700

On Jul 20, 2007, at 11:14 AM, Dan Doughtie wrote:

I am reading in a text file.

First of all, you do not need to have it wrapped in a tell application "Finder" block; it is a direct OSAX call to Standard Additions.

Secondly, to read a file, you do not need to open it for access.  Doesn't hurt to do so, though.

Anyway, this script will work for you.  You can replace the "choose file" line with the hard coded file name if the file is always the same name and in the same location.

set foo to read (choose file)
set start to (offset of "PAGES" in foo) + ((count "PAGES") + 1)
set PageInfoSet to paragraphs of text start through end of foo

-- Michelle

-- 
Power is the ability to not have to please.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Reading Text File in only produces one item as list (From: Dan Doughtie <email@hidden>)

  • Prev by Date: Re: Finding Filenames that contain a certain string
  • Next by Date: Re: AppleScript-Users Digest, Vol 4, Issue 334
  • Previous by thread: Reading Text File in only produces one item as list
  • Next by thread: Re: AppleScript-Users Digest, Vol 4, Issue 334
  • Index(es):
    • Date
    • Thread