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

Re: Appending text?


  • Subject: Re: Appending text?
  • From: Michelle Steiner <email@hidden>
  • Date: Tue, 15 May 2007 18:37:50 -0700

On May 15, 2007, at 4:40 PM, Gary Franks wrote:

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:

Here is how I would do it:

set inputPath to (choose folder with prompt "Select the Source Folder")
set outputFile to (choose file name with prompt "Select Destination File" default location (path to documents folder) default name "myNewFile")


tell application "Finder"
set sourceFiles to files of inputPath whose creator type is "R*ch" and file type is "TEXT" as alias list
end tell
set outputText to ""
repeat with thisFile in sourceFiles
set outputText to outputtext & (read thisFile) & return
end repeat
open for access outputFile with write permission
write outputText to outputFile
close access outputFile
tell application "Finder"
set creator type of outputFile to "R*ch"
set file type of outputFile to "TEXT"
end tell


-- Michelle

--
"Cut the red wire (clip) (turn page) but first...."

_______________________________________________
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: 
 >Appending text? (From: Gary Franks <email@hidden>)

  • Prev by Date: Re: replacing selected text in a document
  • Next by Date: Re: Filemaker 8.5 stored applescript problem
  • Previous by thread: Re: Appending text?
  • Next by thread: Re: Appending text?
  • Index(es):
    • Date
    • Thread