deleting a file whose name contains a particular character

i hope you will excuse my ignorance … but i would like to write an apple script which, when run, would prompt me to select a folder, and which would then delete all the files within then folder whose name contains “~”.

i am namely faced with constantly having to do that manually when saving .nib files and it’s a real pain in the ass…

could someobdy help me out with this? i will be eternally grateful.

all best,
psychomachine

Hi

Try this

tell application “Finder”
delete (every file of (choose folder) whose name contains “-”)
empty trash – comment out to be sure not to delete wrong files
end tell

Roland

that’s absolutely brilliant. i think it’s high time i started learning applescript.
many thanks indeed.