I am going to try my hand at Applescript to automate a simple task in the lab I administer, but I don’t know enough about Applescript yet to know from what angle I should come at this problem.
I am trying to make a script that runs every few minutes and cleans up files on the desktop moving them to the trash.
If Word is not running, it should move all word files to the trash. If Powerpoint is not running, it should move all Powerpoint files to the trash. If Preview is not running, it should move all PDF files to the trash.
Sounds simple, huh? I read in the FAQ how to find out if the applications are running with something like
tell application “System Events” to (name of processes) contains “someprogram”
and that makes sense. I am having more trouble understanding how to make Finder work with files. Can I make Finder delete all the files of a certain type? That would help make an easy script.
Also, and this is entirely a frosting on the cake sort of thing, can Applescript tell when the screensaver is running and do a cleanup then?
Thanks for any pointers/suggestions!
Heath