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 |