Simple Cleanup Script

It has been a long time since I have had to write any detailed AppleScripts and all of my books are for Pre OS X… We are doing a major roll out of new G5 systems and while I have used Package Maker to streamline the majority of the installation process, I am finding that there are a ton of items that I just need to have deleted off of the new systems… so the question is… what, in very clear terms, is the command and syntax to remove an item to the trash. I know it involves Tell Finder and the Delete Command, but other that that I am at a loss (and I am mad at apple that ‘Record’ will not reveal this little trick. For the sake of simplicity, we will use the application iChat. What is the exact command that I would need to enter to have AppleScript remove the iChat application and put it in the trash. Thank you!!! :rolleyes:

First, moving a file to the trash is as simple as telling the Finder to delete the item:

Moving an application is a bit more complex. first you have to make sure it is on the user’s machine and isn’t running, then you can trash it:

Jon


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

That was a little more complex than I was looking for but definately a great piece for future reference. Luckily, my script can be much simpler since it will be used during the build process. So my script looks like this:

Tell application “Finder”
Activate
Delete File “:Applications:iChat”
Delete File “:Applications:Chess”
End Tell

It’s not at pretty as your script, but it is all that I need for the moment. Thanks a ton for your help!!