First of all, let me say I am not a scripter. I can typically read a completed script and get a general idea of what it does, but I have had little success writing my own. That being said, I need a (hopefully) simple script that will read a text file list of file names, search for each name and move that file to the trash. We have a mail server that spits out errors every so often and we need to be able to batch find the offending files and trash them. Is this possible in AppleScript, or would it be easier as a batch script?
Anyone interested in taking this on? Thanks in advance!
Bryan
While possible in Applescript, if it were me writing it I’d use a shell script instead. Probably because I find them easier to write, faster to debug and less convoluted then Applescripts when dealing with Unix files.
That was my thinking as well. Ideally, I would create a text file as an input file, one entry per line, filter it through the script, the script would read each line, do a find for that file name (or portion of the name) and then either move it to the trash folder or delete it outright. I think I’d like it going to the trash folder, so I can see what’s being dumped. Then after I’m sure the script is working properly, I can change it to rm.
Bryan