• 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
Appending text?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Appending text?


  • Subject: Appending text?
  • From: Gary Franks <email@hidden>
  • Date: Tue, 15 May 2007 18:40:46 -0500

I'm a rookie. This is my 2nd script and I was beginning to get cocky, as I completed my 1st script without help. Other than volumes of reading materials. Now, more frustrated and less cocky, here I am. I'm trying to write a script that will open a large number of text files (BBEdit) from a folder and append each of them to a new BBEdit document in another destination folder. (Many short documents into one long document.) My script:

on run
set inputPath to (choose folder with prompt "Select the Source Folder")

set outputPath to (choose folder with prompt "Select a Destination Folder")

tell application "Finder"

make new file with properties {name:"myNewFile", creator type:"R*ch", file type:"TEXT"} at outputPath

set numFiles to (count files in folder inputPath)

repeat with loopVar from 1 to numFiles

tell me

set myWritableFile to outputPath & "myNewFile" as text

set openWritableFile to open for access myWritableFile with write permission

set mySource to read file loopVar as text

write mySource to myWritableFile as string starting at eof

close access myWritableFile

end tell

end repeat

end tell

end run

Can't seem to read the text from the files in the source folder. I'm hung there after many failures. Appreciate any help and appreciate this list.
G
 _______________________________________________
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: Appending text?
      • From: Bill Hernandez <email@hidden>
    • Re: Appending text?
      • From: Michelle Steiner <email@hidden>
    • Re: Appending text?
      • From: James Nierodzik <email@hidden>
  • Prev by Date: replacing selected text in a document
  • Next by Date: Re: Appending text?
  • Previous by thread: Re: replacing selected text in a document
  • Next by thread: Re: Appending text?
  • Index(es):
    • Date
    • Thread