• 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: Using list from text file to create folder, search, and copy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using list from text file to create folder, search, and copy


  • Subject: Re: Using list from text file to create folder, search, and copy
  • From: Walter Ian Kaye <email@hidden>
  • Date: Mon, 2 Feb 2004 12:04:34 -0800

At 01:15p -0500 02/02/2004, Christopher Rosado didst inscribe upon an electronic papyrus:

Hi Walter-

Thanks for your help. To answer your question, I will create each text
file manually.

I've created my text document. "find.txt" as discussed and have run the
script only to get this error "End of file" @
read fref for 1 -- skip return

Here's what I'm running:
set desktopPath to (path to desktop) as string
set datafile to desktopPath & "find.txt"
set fref to open for access alias datafile
set folderName to read fref before return
read fref for 1 -- skip return
set fileList to every paragraph of (read fref)
close access fref

{folderName, fileList}

Any idea why I'd get that error?

Hmm... someone mentioned once about problems with before/until... maybe this is what they were talking about.

So I guess we'll do it differently. Try this:

set desktopPath to (path to desktop) as string
set datafile to desktopPath & "find.txt"
set paras to read alias datafile
set folderName to paragraph 1 of paras
set fileList to paragraphs 2 thru -1 of paras
{folderName, fileList}

Better behavior?


-Walter
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Using list from text file to create folder, search, and copy
      • From: email@hidden (Christopher Rosado)
References: 
 >Re: Shell-wrap a file in 2 variable strings (From: Gnarlodious <email@hidden>)
 >Re: Shell-wrap a file in 2 variable strings (From: Axel Luttgens <email@hidden>)
 >Using list from text file to create folder, search, and copy (From: email@hidden (Christopher Rosado))
 >Re: Using list from text file to create folder, search, and copy (From: Walter Ian Kaye <email@hidden>)
 >Re: Using list from text file to create folder, search, and copy (From: email@hidden (Christopher Rosado))

  • Prev by Date: Re: Expect commands in Applescript
  • Next by Date: Re: deeply frustrating: how to copy/move a file from one place to another
  • Previous by thread: Re: Using list from text file to create folder, search, and copy
  • Next by thread: Re: Using list from text file to create folder, search, and copy
  • Index(es):
    • Date
    • Thread