• 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
Question about list structure
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about list structure


  • Subject: Question about list structure
  • From: Kevin Walzer <email@hidden>
  • Date: Thu, 24 Nov 2005 12:14:31 -0500
  • Organization: WordTech Software

I'm having problems getting a list correctly read in an AppleScript program I'm writing. The script runs a shell script, writes the output to a file, then reads the file as a list. Here is my code that reads the file data:

set theSource to "Macintosh HD:private:tmp:findoutput"
		set open_file to open for access file theSource without write permission
		set theIntermediateOutput to read open_file using delimiter return
		close access open_file
		set theFinalOutput to theIntermediateOutput as list



This code returns the following sample output:

{"/Users/kevin/Desktop/amsn received files/avg.xls
/Users/kevin/Desktop/avg.xls
"}

This is the way the output is written to the file, with each item returned by the originating shell script appended to the file with a newline/return.

The problem is that I need the output to be read as a standard AppleScript list, i.e. {"/Users/kevin/Desktop/amsn received files/avg.xls", "/Users/kevin/Desktop/avg.xls"}. Apparently this is currently read by AppleScript as a list with a single item.

Are there any manipulations I can do to this data (or modifications to my code) to get it converted into the proper list structure?


-- Cheers,

Kevin Walzer, PhD
WordTech Software - "Tame the Terminal"
http://www.wordtech-software.com
sw at wordtech-software.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Question about list structure
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: Mail "get attachment" broken?
  • Next by Date: Re: Mail "get attachment" broken?
  • Previous by thread: Re: automatic authentication
  • Next by thread: Re: Question about list structure
  • Index(es):
    • Date
    • Thread