Wrong confirmation dialog to replace file

Hi,

I’m doing a personal backup application which is developed using applescript resources. When I configure the backup, I use this line to know the path and name for the log file:

	set log_file to choose file name default name "BackupLog.txt" with prompt "Choose a filename to log the backup." without invisibles

This works fine, but if the file exists in this place, appears a warning dialog with a replace confirmation. The problem is that I really append ( and I want to append ) text to this file because I use shell scripting to add lines to the log:

	do shell script "echo " & "'Copied file  ' " & quoted form of tpath & " >> " & quoted form of log_file

Is there any way to change the default dialog behaviour from ‘Replace’ to ‘Append’ ??

Regards,
Joan B. Altadill

joan:

Is there a specific reason you need to provide the log file as a choice? Do you have multiple log files? If so, try making a list of the filenames, and then choose from list:

set log_list to {"log1.txt", "log2.txt", "log3.txt"}
set a to choose from list log_list

You now have a variable [a] that you can send to your shell script, once the container of the file is identified.

If you only have the one log file, you can dispense with the choosing altogether.