I want to copy files from the Application bundle to a new folder

I want to copy files from the Application bundle to a new folder…
I defined the output_folder like this:
set the output_folder to (choose folder with prompt “OUTPUT FOLDER:”) as alias

The files I’d like to copy are in “Contents:Resources:Files”


on copy_files(output_folder)
	try
		set the this_app to (path to me) as alias

		tell application "Finder"
			duplicate (the files of folder "Files" in folder "Resources" in folder "Contents" in folder (path to me)) to �
				folder output_folder with replacing
		end tell
		
	end try
end copy_files

any idea?

Try this:

on copy_files(output_folder)
	try
		set output_folder to output_folder as string
		tell application "Finder"
			duplicate (files of (folder (path to me as string & "Contents:Resources:Files:"))) to folder output_folder with replacing
		end tell
	on error the_error
		beep
		activate
		display dialog "Error: " & the_error buttons {"OK"} default button 1 with icon 0 giving up after 10
	end try
end copy_files

Jon

Thanks! I had to edit it a bit to make it work:

on copy_files(output_folder)
	try
		set output_folder to output_folder as string
		tell application "Finder"
			duplicate (files of (folder (((path to me) as string) & "Contents:Resources:Files"))) to folder output_folder with replacing
		end tell
	on error the_error
		beep
		activate
		display dialog "Error: " & the_error buttons {"OK"} default button 1 with icon 0 giving up after 10
	end try
end copy_files