Re: Appending text?
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