I’m pretty sure I am simply overlooking something but in my script below I have a dialog box open up prompt for a file name. I enter into the box newfilename, and it then copies defaultfilename.txt to newfilename.txt.
The problem i am having is that the new file name is coming out ‘newfilename’.txt
What is causing the apostrophes to populate around the newfilename?
property theCommand : "" repeat while theCommand is "" display dialog "Input File Name:" default answer theCommand set theCommand to text returned of result end repeat try do shell script "cp -r \"/Volumes/Xserve3/files/defaultfilename.txt\" \"/Volumes/Xserve3/files/" & quoted form of theCommand & ".txt\"" on error errorMsg number errorNum display alert "Error " & errorNum message errorMsg buttons "Cancel" default button 1 end try
Any help is greatly appreciated.