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

Reading Text File in only produces one item as list


  • Subject: Reading Text File in only produces one item as list
  • From: Dan Doughtie <email@hidden>
  • Date: Fri, 20 Jul 2007 14:14:29 -0400
  • Thread-topic: Reading Text File in only produces one item as list

I am reading in a text file. When I look at the variable¹s value in
ScriptDebugger it says it is ³Styled Text² (funky little red and blue A¹s
symbol). I can¹t seem to get the value of the variable to break into any
list. I can set something to ³word 9²  and get that word. But what I need to
do is grab everything after ³PAGES² to the end of the file. In a 10.3.9
version I used Acme Widgets to tokenize using PAGES as the token and then
grabbing item 2. That still works on my old G5 using ASW 3.0.5. (I have a
corp license with Wayne but he hasn¹t sent me 3.0.6  which I assume works on
intel).But the version of Widgets I have won¹t work on an Intel Mac and I
was told by my handlers not to use any third party OSAX. But I can¹t coerce
this  puppy into a list. This is a basic Applescript 101 script. The text
file is generated by a program called ALS. The file is not a .txt file but
acts like one. Is there a way to coerce it into usable data? I¹ve tried
setting the text delimiters to ³a², which should have broken it into lots of
pieces but it did nothing. Still a list with 1 item and that 1 item had
everything in it.

tell application "Finder"
    open for access file IDFFilE2
    set PageInfoSet to read file IDFFilE2 as text
    close access file IDFFilE2
end tell

Here is what the data looks like (there are tabs between items) copied
directly out of Scriptdebugger. Looks just like this in BBEdit also.

Tab File
PRODUCT
DATE    20-JUL-07
PAPER    Daily
EDITION    Daily
PARAMETERS
HMEASURE    INCHES
VMEASURE    INCHES
TOTALWIDTH    14.0
TOTALDEPTH    22.5
TOPMARGIN    0.25
BOTTOMMARGIN    0.75
INSIDEMARGIN    3.0
OUTSIDEMARGIN    3.0
LIVEWIDTH    8
LIVEDEPTH    21.5
COLUMN    6
GUTTER    0.11
SECTIONLIST
1    16    16
PAGES
1*A*        Black
2*A*        Black
3*A*        Black
4*A*        Black
5*A*        Black
6*A*        Black
7*A*        Black
8*A*        Black
9*A*        Black
10*A*        Black
11*A*        Black
12*A*        Black
13*A*        Black
14*A*        Black
15*A*        Black
16*A*        Black



Dan Doughtie
Morris Technology Services

 _______________________________________________
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

  • Follow-Ups:
    • Re: Reading Text File in only produces one item as list
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: Finding Filenames that contain a certain string
  • Next by Date: Re: Finding Filenames that contain a certain string
  • Previous by thread: Re: Choose from list goes out of screen range
  • Next by thread: Re: Reading Text File in only produces one item as list
  • Index(es):
    • Date
    • Thread