I have searched the posts here for a solution, but apparently my noobie-ness is limiting my success. I did find one wonderful script …
choose folder with prompt "Combine all text files from this folder:"
set sourceFolder to result
choose file name with prompt "Save combined text file as:" default location result default name "untitled.txt"
set combinedFile to quoted form of POSIX path of result
-- display dialog "the value of sourcefolder is" & sourceFolder
-- display dialog "the value of combinedfile is" & combinedFile
try
do shell script "cd " & quoted form of POSIX path of sourceFolder & "; cat *.txt > " & combinedFile
on error errorMsg number errorNum
display dialog "Error: (" & errorNum & "):" & return & return & errorMsg buttons "Cancel" default button 1
end try
but alas, I really need this in a droplet so my feeble attempt to convert went something like this…
on open (theItems)
tell application "Finder"
set sourceFolder to quoted form of POSIX path of (container of first item of theItems as string)
set combinedFile to quoted form of POSIX path of (container of first item of theItems as alias) & "00-Data.txt"
display dialog "the value of sourcefolder is" & sourceFolder
display dialog "the value of combinedfile is" & combinedFile
do shell script "cd " & quoted form of POSIX path of sourceFolder & "; cat *.txt > " & combinedFile
end tell
end open
the display dialogs were added in an attempt to debug, but i have not the skill set to do this.
All the files will always be saved as “00-Data.txt” I can tell that adding the filename the way I am is causing the problem, because the display dialog from the working script displays the path with the filename outside the quotes. Any help would be great.
thanks all,
Shawn